Discussion:
printf rounding
(too old to reply)
jacob navia
2015-06-01 09:30:19 UTC
Permalink
Raw Message
The standard specifies that printf "rounds the value to the appropiate
number of digits".

This rounding is round to the nearest or something else?

Is this rounding affected by the rounding mode?

I have implemented rounding to the nearest, but now I am not so sure.

Should I use the current rounding mode of the machine?

Where is the precise type of rounding of printf specified in the standard?

Thanks in advance and sorry if this is a stupid question.

jacob
jacob navia
2015-06-01 10:24:47 UTC
Permalink
Raw Message
Post by jacob navia
The standard specifies that printf "rounds the value to the appropiate
number of digits".
This rounding is round to the nearest or something else?
Is this rounding affected by the rounding mode?
I have implemented rounding to the nearest, but now I am not so sure.
Should I use the current rounding mode of the machine?
Where is the precise type of rounding of printf specified in the standard?
Thanks in advance and sorry if this is a stupid question.
jacob
Sorry, I found it. It is several pages further down...

Loading...