fork(2) download
  1. import std.stdio;
  2.  
  3. void main()
  4. {
  5. writeln(0.1 + 0.2 != 0.3); // constant folding is done in real precision
  6.  
  7. auto a = 0.1;
  8. auto b = 0.2;
  9. writeln(a + b != 0.3); // standard calculation in double precision
  10. }
  11.  
Success #stdin #stdout 0s 2120KB
stdin
Standard input is empty
stdout
false
true