From a0c12ad2595f9b52c3b2b82b81c2e17ed9bd9268 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Thu, 29 Dec 2011 09:51:44 -0700 Subject: [PATCH] Added another floatToIntBits test --- test/Floats.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/Floats.java b/test/Floats.java index 2494088b01..775b391ffd 100644 --- a/test/Floats.java +++ b/test/Floats.java @@ -211,7 +211,8 @@ public class Floats { double d = (double) z; expect(d == 12345.0); } - + + // Test floatToIntBits { int orig = 0x7f800001; float NaN = Float.intBitsToFloat(orig); @@ -220,6 +221,14 @@ public class Floats { expect(result == expected); } + { + int orig = 0x7f801001; + float NaN = Float.intBitsToFloat(orig); + int result = Float.floatToIntBits(NaN); + int expected = 0x7fc00000; + expect(result == expected); + } + { int orig = 0x00800001; float number = Float.intBitsToFloat(orig);