www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10145] New: "real" datatype on x64 doesn't accurately represent a floating point number

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10145

           Summary: "real" datatype on x64 doesn't accurately represent a
                    floating point number
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: gooberman gmail.com



---
When converting float variables to and from real variables, the actual value
gets munged up in to something indecipherable. real values converted to strings
print out wrong values, and converting them back to floats keep garbage values
about.

I discovered this one when using std.json, which uses the real type to track
floating point values rather than float/double. Currently working around it by
making a copy of std.json, sticking it in another namespace, and replacing real
with double.

Tested with latest beta.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10145


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



I suggest to add a small test case that shows the problem.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23 2013