commit-classpath
[Top][All Lists]
Advanced

[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: Sun, 10 Oct 2004 14:42:58 -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: 
                Sun 10/10/2004 at 18:36 (Europe/Stockholm)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed







/**************************************************************************/
[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:  Fixed
Privacy:  Public
Assigned to:  smarothy
Status:  Closed
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&amp;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&amp;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/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]