//Returns in double type. //1 if positive.0, 0 if 0.0, if it is a negative number-1.Returns 0. System.out.print(Math.signum(10)); // 1.0 System.out.print(Math.signum(0)); // 0.0 System.out.print(Math.signum(-10)); // -1.0
The Math class contains methods for performing basic numerical operations such as exponential, logarithmic, square root, and trigonometric functions.
Returns the sign element of the argument. Zero if the argument is zero, 1.0 if the argument is greater than zero, -1.0 if the argument is less than zero.
The wording is slightly different, but it is as stated in the comment out above.