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!-).

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


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