Added another floatToIntBits test

This commit is contained in:
Seth Goings 2011-12-29 09:51:44 -07:00
parent f5a168f584
commit a0c12ad259

View File

@ -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);