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: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: Fri, 20 Jul 2007 11:44:49 +0200
- Subject: 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!-).
If I remember correctly my reading of the F2003 draft there are the usual
NEAREST (tie to even), ZERO, UP, DOWN rounding modes for I/O plus another
one (don't remember the name) which does the 'correct for business' rounding
(tie to up).
Dominique