mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-30 07:14:09 +08:00
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
@ -1,3 +1,10 @@
|
||||
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.
|
||||
|
||||
1999-04-13 Tom Tromey <tromey@cygnus.com>
|
||||
|
||||
* java/lang/natSystem.cc (arraycopy): Don't always use jbyteArray;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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…
Reference in New Issue
Block a user