Javadoc clarification for signum
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1061096 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0a9d609f98
commit
a0c8e5c701
|
@ -576,19 +576,19 @@ public class FastMath {
|
|||
/** Compute the signum of a number.
|
||||
* The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise
|
||||
* @param a number on which evaluation is done
|
||||
* @return -1, 0, +1 or NaN depending on sign of a
|
||||
* @return -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
|
||||
*/
|
||||
public static double signum(final double a) {
|
||||
return (a < 0.0) ? -1.0 : ((a > 0.0) ? 1.0 : a);
|
||||
return (a < 0.0) ? -1.0 : ((a > 0.0) ? 1.0 : a); // return +0.0/-0.0/NaN depending on a
|
||||
}
|
||||
|
||||
/** Compute the signum of a number.
|
||||
* The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise
|
||||
* @param a number on which evaluation is done
|
||||
* @return -1, 0, +1 or NaN depending on sign of a
|
||||
* @return -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
|
||||
*/
|
||||
public static float signum(final float a) {
|
||||
return (a < 0.0f) ? -1.0f : ((a > 0.0f) ? 1.0f : a);
|
||||
return (a < 0.0f) ? -1.0f : ((a > 0.0f) ? 1.0f : a); // return +0.0/-0.0/NaN depending on a
|
||||
}
|
||||
|
||||
/** Compute next number towards positive infinity.
|
||||
|
|
Loading…
Reference in New Issue