MATH-479 FastMath.signum(-0.0) does not agree with Math.signum(-0.0)
(tests already added as part of math483) git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_X@1060895 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
06b40fbd01
commit
839130d338
|
@ -579,7 +579,7 @@ public class FastMath {
|
|||
* @return -1, 0, +1 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 : (Double.isNaN(a) ? Double.NaN : 0.0));
|
||||
return (a < 0.0) ? -1.0 : ((a > 0.0) ? 1.0 : a);
|
||||
}
|
||||
|
||||
/** Compute next number towards positive infinity.
|
||||
|
|
Loading…
Reference in New Issue