[Issue 22740] New: const float values should be rounded to float

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 5 23:15:15 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22740

          Issue ID: 22740
           Summary: const float values should be rounded to float
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

The following:

 import std.stdio;

 const float f = 0.2f;

 void main()
 {
    writeln(f - 0.2);
 }

prints 0, but it should print 2.98023e-09

--


More information about the Digitalmars-d-bugs mailing list