This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: non-compatible round-off when printing for gfortran


>> Ad hoc I don't see why the others print "0.2" for "0.2500000"; following
>> normal school maths one would round to 0.3.
>
>Tie rounds to even rule (used in all modern CPUs for rounding; if someone
>has a good explanation, I'd be interested, the most plausible I have
>heard is some 'entropic' argument: 2 is better than 1.9999!-).

Round to even applies only to numbers exactly midway between two
representable values; it guarantees that statistically half of them are
rounded up and half down, so as not to introduce a sistematic bias in
the calculations.

Salvatore 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]