0.6 IEEE754. 0,599999964237213134765625 (0x3f199999) 0,600000083446502685546875 (0x3f19999b). 0.60000002384185791015625 (0x3f19999a) , WriteLine.
You need to either use the floating point representation with higher precision (double), or limit the number of decimal places that WriteLine prints:
float f = 0.6; Console.WriteLine("{0:N6}", f);
source
share