(j3.2006) J3/09-292 - J3 Fortran interp letter ballot #19 - due19-Oct-2009

Van Snyder Van.Snyder
Mon Oct 19 16:34:48 EDT 2009


On Mon, 2009-10-19 at 08:29 -0700, Bill Long wrote:
> Added Comment for F03/0039:
> 
> There is no HYPOT intrinsic function in Fortran 2003. It is a Fortran 
> 2008 feature. I think this interp is out of order.  Suggestions for 
> changes to HYPOT should be in the form of a J3 paper of a FCD ballot 
> comment.
> 
> [I retain my NO vote, and suggest the interp should be rejected.]

I would go a step further and advocate that HYPOT is unnecessary and
ought to be removed from the draft, given that it is the same as CABS or
NORM2.

In place of HYPOT(A,B) one can write either
  ABS(CMPLX(A,B))
or
  NORM2([A,B])

Admittedly, both formally require the construction of a temp, but clever
optimizers, especially ones that inline CABS, ought to be able to get
rid of it.

We don't have many intrinsic functions as trivial as HYPOT, and we
haven't introduced any other than HYPOT in 2008.

> Cheers,
> Bill
> 
> 
> 
> 
> Bill Long wrote:
> >
> > -----------------------------------
> > Comments:
> > 
> > 
> > F03/0039:
> > ---------
> > 
> > The text in the IEEE 754-2008 standard says (bottom of page 43):
> > 
> > "For the hypot function, hypot(?0, ?0) is +0, hypot(??, qNaN) is +?,
> > and hypot(qNaN, ??) is +?. "
> > 
> > If the argument for changing the rules for IEEE_LOGB() in Interp
> > F03/0034 is to make the Fortran rules match the IEEE rules, then the
> > same argument would seem to apply here.  Yet the changes I see
> > proposed do not result in HYPOT returning the IEEE-required results
> > when one of the arguments is a NaN and the other is an Infinity.
> > 
> > If we really want the results to be NaN, then the interp should
> > clearly state that the values we require contradict the IEEE rules.
> > 
> 




More information about the J3 mailing list