module pind.samples.ja.floating_point.floating_point_4; import std.stdio; void main() { float result = 0; // 1000回ごとに0.001を追加する: int counter = 1; while (counter <= 1000) { result += 0.001; ++counter; } if (result == 1) { writeln("As expected: 1"); } else { writeln("DIFFERENT: ", result); } }