Fortran 90 IEEE Question

Thomas MacDonald uunet!ironwood.cray.com!tam
Fri Feb 10 11:58:00 PST 1995


David G. Hough writes:
> nextafter(+inf,+inf) is +inf without any exception per IEEE 754 appendix.
> I don't know what the Fortran-90 people might have been thinking of.  I don;t
> care for either definition; simpler to implement and test would have been
> 
> 	next(x)
> 
> which returns the next more positive representable number from x; with
> next(+inf) = +inf and next(nan) = nan.

Well, I don't know what the Fortran-90 people had in mind either.  I think
the real point is that there is a Fortran-90 standard and vendors need to
do something.  We can argue about how F90 should have done but that
doesn't give any guidance to all the vendors who will then all do it
differently (thay might anyway).  What I'm trying to find out is what's
reasonable for:

	X = NEAREST(HUGE, +1.0)  ! is this +infinity?
	Y = NEAREST(X, +1.0)     ! is this NaN?

and then try to get the vendors to be consistant (easy to say).  Maybe
you're advocating that programmers just avoid the NEAREST function.
Then it doesn't matter what the vendors do.

Tom MacDonald
tamacray.com



More information about the Numeric-interest mailing list