[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-cp] [bugs #9106] ByteBuffer.putDouble should use Double.doubleTo
From: |
Sven de Marothy |
Subject: |
[commit-cp] [bugs #9106] ByteBuffer.putDouble should use Double.doubleToRawLongBits |
Date: |
Fri, 08 Oct 2004 12:29:14 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 |
This mail is an automated notification from the bugs tracker
of the project: classpath.
/**************************************************************************/
[bugs #9106] Latest Modifications:
Changes by:
Sven de Marothy <address@hidden>
'Date:
Fri 10/08/2004 at 16:22 (Europe/Stockholm)
What | Removed | Added
---------------------------------------------------------------------------
Assigned to | None | smarothy
/**************************************************************************/
[bugs #9106] Full Item Snapshot:
URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=9106>
Project: classpath
Submitted by: Tom Quarendon
On: Wed 05/26/2004 at 09:36
Category: None
Severity: 5 - Average
Resolution: None
Privacy: Public
Assigned to: smarothy
Status: Open
Platform Version: None
Summary: ByteBuffer.putDouble should use Double.doubleToRawLongBits
Original Submission: When converting a double to a series of bytes before
writing it to a buffer, the Double.doubleToRawLongBits method should be used,
and not the Double.doubleToLongBits method. That way the bit pattern of the
double is exactly preserved. Using doubleToLongBits writes all NaNs out with
the same bit pattern. So if you write the Nan
Double.longBitsToDouble(0x7ff800000000000CL) to a buffer then read it back in,
you get Double.longBitsToDouble(0x7ff8000000000000L)
Follow-up Comments
------------------
-------------------------------------------------------
Date: Thu 05/27/2004 at 06:59 By: Tom Quarendon <quarendont>
Attatched a test case that passes under Sun JDK1.4. Don't believe that it will
pass when using Classpath.
-------------------------------------------------------
Date: Thu 05/27/2004 at 06:29 By: Michael Koch <mkoch>
Do you have a testcase that triggers this problem ? In java.io.DataInputStream
and java.io.DataOutputStream the spec explicitely says to use not the "raw"
versions. Unfortunately this is not specified so hard for java.nio.
File Attachments
-------------------
-------------------------------------------------------
Date: Wed 06/02/2004 at 20:03 Name: TestDoubleWritingMain.java Size: 589B
By: gilead
The same as TestDoubleWriting.java but runnable without JUnit
http://savannah.gnu.org/bugs/download.php?item_id=9106&item_file_id=1365
-------------------------------------------------------
Date: Thu 05/27/2004 at 06:59 Name: TestDoubleWriting.java Size: 459B By:
quarendont
Test case that works under Sun JDK1.4, but (probably) not under Classpath
http://savannah.gnu.org/bugs/download.php?item_id=9106&item_file_id=1344
For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=9106>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [commit-cp] [bugs #9106] ByteBuffer.putDouble should use Double.doubleToRawLongBits,
Sven de Marothy <=