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:
Sebastian Bazley 2011-01-19 18:29:45 +00:00
parent 06b40fbd01
commit 839130d338
1 changed files with 1 additions and 1 deletions

View File

@ -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.