How do I get rid of the rounding of "printf"?
I'm using float (% f) to read numbers from a file, and when I "printf" them they get rounded. They have only five decimal places.
TY
regards ;D
How do I get rid of the rounding of "printf"?
I'm using float (% f) to read numbers from a file, and when I "printf" them they get rounded. They have only five decimal places.
TY
regards ;D
You can do something like %.8f
See this page: printf and scanf format codes
The rounding isn't caused by printf(), however. You should consider using doubles instead of floats, if you need more accuracy.
printf() is happy to print up as many decimal places as you like, but that doesn't mean that floats have suddenly changed into something with more range.