This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: non-compatible round-off when printing for gfortran
- From: Salvatore Filippone <salvatore dot filippone at uniroma2 dot it>
- To: Fortran at gcc dot gnu dot org
- Date: Fri, 20 Jul 2007 13:24:23 +0200
- Subject: Re: non-compatible round-off when printing for gfortran
- Reply-to: salvatore dot filippone at uniroma2 dot it
>> 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