www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15861] New: Wrong double-to-string conversion with -O


          Issue ID: 15861
           Summary: Wrong double-to-string conversion with -O
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Keywords: wrong-code
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

///////////////////////// test.d /////////////////////////
import std.format;

void main()
    assert(format("%.18g", 4286853117.0) == "4286853117");

Passes without -O, asserts with -O.

Introduced in https://github.com/D-Programming-Language/dmd/pull/4911

Apr 01 2016