https://issues.dlang.org/show_bug.cgi?id=20320
Issue ID: 20320
Summary: format("%f") leeds to wrong output
Product: D
Version: D2
Hardware: Other
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
import std.stdio;
void main() {
real a = 0.16;
real b = 0.016;
writefln("%.1f", a);
writefln("%.2f", b);
}
----
Output:
---
0.2
0.01
----
I am using dmd on Windows. It doesn't happen when compiling with -m32.
----
$ dmd
DMD32 D Compiler v2.088.1-dirty
Reported by Yui Hosaka in the forum:
https://forum.dlang.org/post/[email protected]
--