diff options
Diffstat (limited to 'libjava/java/lang')
-rw-r--r-- | libjava/java/lang/natDouble.cc | 7 | ||||
-rw-r--r-- | libjava/java/lang/natFloat.cc | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/libjava/java/lang/natDouble.cc b/libjava/java/lang/natDouble.cc index 1799088..8d8c788 100644 --- a/libjava/java/lang/natDouble.cc +++ b/libjava/java/lang/natDouble.cc @@ -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; } diff --git a/libjava/java/lang/natFloat.cc b/libjava/java/lang/natFloat.cc index e3189be..5712fd4 100644 --- a/libjava/java/lang/natFloat.cc +++ b/libjava/java/lang/natFloat.cc @@ -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; } |