-
Bug
-
Resolution: Fixed
-
P5
-
1.1, 1.1.6, 1.2.0
-
1.2beta4
-
x86, sparc
-
solaris_2.4, windows_95
-
Not verified
Name: swC45995 Date: 01/29/97
In Windows NT the the Math.IEEEremainder method wrongly computes the
IEEE 754 remainder operation. According the IEEE 754 standard:
... the remainder value is mathematically equal to x - y * n where n
is the mathematical integer closest to the exact mathematical value of
the quatient x / y; if two mathematical integers are equally close to
x / y then n is the integer that is even. (JLS, #20.11.14)
Thus the IEEE remainder operation on the operands 9.0f and 3.0f must
produce -3.0f as the result. However compilation and subsequent execution
of the test:
public class test
{
public static void main(String argv[])
{
float f = 9.0f;
System.out.println(Math.IEEEremainder(f, 6.0f))
}
}
produces the following output:
novo40% javac test.java
novo40% java test
3.0
instead of expected:
-3.0
======================================================================
- duplicates
-
JDK-4129480 java.lang.Math.rint(double) fails for -0.0d and 10.5d on win95
- Closed