Andris Ratas wrote:
On line 1 the float value is passed as an argument to the formatter. As far as my understanding concers the output here should be 123,456000 but the result is 123,456001. On line 3 I pass a double value as an argument and the result is as I expect. How come passing float value is different from passing double value
That's how floating point works. There is only so much precision. And sometime it is just not accurate.
And BTW, since the system keeps the floating point in base 2, and you are envisioning it in base 10, sometimes, what looks like it should be simple -- in terms of precision, is not.
Henry