[Bug 45] New: Bug in conversion of floating point literals

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 13 04:52:33 PST 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=45

           Summary: Bug in conversion of floating point literals
           Product: D
           Version: 0.149
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au


Literals are treated (incorrectly) as type real when used in an initialiser,
but as type double when used in an assignment. This is an extremely difficult
bug to track down, as it is essentially bad code generation, so I've marked it
as critical.

void main()
{
    real a = 3.40483; // this is treated as 3.40483L
    real b;
    b = 3.40483;
    assert(a==b);
}


-- 




More information about the Digitalmars-d-bugs mailing list