-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.6, 1.2.0
-
sparc
-
solaris_2.5
Name: mgC56079 Date: 09/20/98
According to the JLS 20.11.18 Math.round(Float.NaN) should return 0.
=== Here is the test ===
public class Round {
public static void main(String args[]) {
System.out.println(Math.round(Float.NaN));
}
}
=== Sample run ===
% java Round
2147483647
======================================================================
- duplicates
-
JDK-1229191 (math) Converting floating-point numbers to ints doesn't always work properly
- Closed
- relates to
-
JDK-4686820 narrowing from float -NaN to int should produce constant 0
- Closed