natDouble.java (doubleToLongBits): ensure that all NaNs are always converted to the same long value.
1999-04-14 Andrew Haley <aph@cygnus.com> * java/lang/natDouble.java (doubleToLongBits): ensure that all NaNs are always converted to the same long value. * java/lang/natFloat.java (floatToIntBits): ditto, but for float converted to int. From-SVN: r26439
This commit is contained in:
parent
2de45c0679
commit
2b37afcb36
3 changed files with 20 additions and 0 deletions
|
@ -24,6 +24,12 @@ java::lang::Float::floatToIntBits(jfloat value)
|
|||
{
|
||||
union u u;
|
||||
u.d = value;
|
||||
jint e = u.l & 0x7f800000;
|
||||
jint f = u.l & 0x007fffff;
|
||||
|
||||
if (e == 0x7f800000 && f != 0)
|
||||
u.l = 0x7fc00000;
|
||||
|
||||
return u.l;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue