(j3.2006) (SC22WG5.4180) [ukfortran] Urgent: letter ballot on interps

Bill Long longb
Fri Feb 12 10:27:56 EST 2010



Malcolm Cohen wrote:
> Bill Long wrote:
>> N.M. Maclaren wrote:
>>> On Feb 10 2010, Bill Long wrote:
>>>> Comment for F03/0039 - HYPOT()
>>>>
>
> No, there is no temptation and no possibility for confusion.
> 
> That is because the Note in question does not exist in F08.  We deleted it 
> specifically because it created more confusion than enlightenment.
> 

Of course, you are right.  I was looking a a printed 09-007r1 version at 
the time.  Sorry about that.

However, I believe I should have made another comment on this interp 
stronger.  I said

--------------
Further, instead of somewhat obscure

    HYPOT = SQRT(-1.0)

why not be clear about the intent and write

    HYPOT = IEEE_VALUE(X, IEEE_QUIET_NAN)
---------------

More than "obscure", the proposed code is not even legal.  The SQRT 
function explicitly requires that a real argument be >= 0, so SQRT(-1.0) 
has no interpretation in the standard.  The expected outcome of trying 
to compile this example would be a hard error at compile time.  Even 
more reason to go with the alternative, which is not only valid code, 
but effectively self-documenting, and does exactly what is desired. 
(That said, I still would prefer no edit at all.)

Cheers,
Bill




-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list