From 839130d338248aff186e7f0e7e9c80f0e93a6c91 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Wed, 19 Jan 2011 18:29:45 +0000 Subject: [PATCH] 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 --- src/main/java/org/apache/commons/math/util/FastMath.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/math/util/FastMath.java b/src/main/java/org/apache/commons/math/util/FastMath.java index b2e9a56eb..6f1cc9f10 100644 --- a/src/main/java/org/apache/commons/math/util/FastMath.java +++ b/src/main/java/org/apache/commons/math/util/FastMath.java @@ -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.