Java Integer signum() MethodThe signum() method of Java Integer class returns the signum function of the specified int value in the method argument. The signum function can be computed as:
Syntax:Following is the declaration of signum() method: Parameter:
Returns:The signum() method returns the signum function of the specified int value in the method argument. Exceptions:NA Compatibility Version:Java 1.5 and above Example 1Output: Result: 1 Result: -1 Result: 0 Example 2Output: Enter Positive Value: 4565 Result: 1 Enter Negative Value: -432 Result: -1 Enter Zero Value: 000 Result: 0 Example 3Output: Output: NaN Output: 0.0 Output: 0.0 Next TopicJava-integer-sum-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India