The following code prints weird results on my machine.

----
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
----

Do you have any idea for this issue?

Reply via email to