commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bugs #9106] ByteBuffer.putDouble should use Double.doubleToRawLongBits


From: Michael Koch
Subject: [bugs #9106] ByteBuffer.putDouble should use Double.doubleToRawLongBits
Date: Fri, 28 May 2004 23:02:40 -0400
User-agent: Mozilla/5.0 (compatible; Konqueror/3.2; Linux; de, address@hidden) (KHTML, like Gecko)

This mail is an automated notification from the bugs tracker
 of the project: classpath.

/**************************************************************************/
[bugs #9106] Latest Modifications:

Changes by: 
                Michael Koch <address@hidden>
'Date: 
                Thu 05/27/04 at 06:29 (GMT)

------------------ Additional Follow-up Comments ----------------------------
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.






/**************************************************************************/
[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/04 at 09:36

Severity:  5 - Average
Resolution:  None
Assigned to:  None
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/04 at 06:29         By: 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.












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]