in reply to Why do I get random numbers?
To summarize what Choroba linked-to, a floating-point number is (of course) in base-two, and the value 1/10 cannot be precisely represented in base-two just as the value 1/3 cannot be precisely represented in base-ten. (0.33333...) The printf function is performing conversions to represent the value in printable base-ten digits, and beyond a certain number of digits you are seeing those calculations break down as garbage takes over. Plus there is always the issue – true in any sort of floating-point calculation even on a pocket calculator – of the number of "significant digits."