in reply to Using (s)printf()
This prints "9.33". Actually, this is what I expect, but the article says it should be 9.34.
If I try the following: printf("%.1f", 9.55);
I get 9.6, which is OK, but if I try printf("%.1f", 43.55);
I get 43.5, which is rounded the wrong way.
Can someone explain this? (Please send me an email (firstname.lastname@example.org)).
|Replies are listed 'Best First'.|
Re: Re: Using (s)printf()
by Hofmator (Curate) on Aug 31, 2001 at 16:20 UTC