浮動小数点数の比較は誤差が出ます。 class Program { static void Main(string[] args) { double a = 0; for (int i = 0; i < 10; i++) { a += 0.1d; } Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"{a} == 1.0d"); if (a == 1.0d) { …
Quote saved.
Login to quote this blog
Failed to save quote. Please try again later.
You cannot quote because this article is private.