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:
Andrew Haley 1999-04-14 07:10:22 +00:00 committed by Andrew Haley
parent 2de45c0679
commit 2b37afcb36
3 changed files with 20 additions and 0 deletions

View file

@ -47,6 +47,13 @@ java::lang::Double::doubleToLongBits(jdouble value)
{
union u u;
u.d = value;
jlong e = u.l & 0x7ff0000000000000LL;
jlong f = u.l & 0x000fffffffffffffLL;
if (e == 0x7ff0000000000000LL && f != 0L)
u.l = 0x7ff8000000000000LL;
return u.l;
}