(j3.2006) out_of_range and sNaN

Bill Long longb
Wed Oct 5 08:43:33 EDT 2016


On Oct 4, 2016, at 11:39 PM, Cohen Malcolm <malcolm at nag-j.co.jp> wrote:

> I agree with Bill that the result is already well-specified.
> 
> It is certainly not obvious from the current text whether SNaN raises 
> INVALID.  Given that one of the intended (by 60559) uses of SNaN is for 
> uninitialized variable representation, there is certainly a case for it 
> raising INVALID here.

On the other hand, the (obvious, efficient) execution of the function would not involve any operation that would trigger INVALID in hardware. So, if we want to require this, there would be a performance hit forcing implementations to either explicitly check for the value and manually force the signal, or perform some waste operation, like X + 0.0, to trigger the signal.  I doubt that anyone would do this unless we specifically say that this extra work is required by the standard.  In terms of checking for an  uninitialized value, I would anticipate there would be other uses of X in nearby code that would trigger INVALID anyway.

Cheers,
Bill

> 
> Cheers,
> -- 
> ........................Malcolm Cohen, Nihon NAG, Tokyo. 
> 
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

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