(j3.2006) out_of_range and sNaN

Bill Long longb
Wed Oct 5 00:22:27 EDT 2016


On Oct 4, 2016, at 7:35 PM, Dan Nagle <danlnagle at me.com> wrote:

> Hi,
> 
> 
>> The standard should say if OUT_OF_RANGE signals IEEE_INVALID
>> if X is a signaling NaN.  Whether it traps or not depends on
>> the trap mode.
> 
> There is a special dispensation for IEEE_CLASS,
> it was a long discussion in plenary.
> 
> I'm hoping we can be explicit and clear.

I would not expect any signal. The function returns true or false, and there is no computation involved in its evaluation.  Only checks for whether the argument is a NaN or Infinity, and then a compare of the value in the case of a normal argument.   I don?t see why this would be any different from any other inquiry about whether the value of the argument is a NaN.  You could use IEEE_CLASS to check for NaN, but the obvious implementation would be a bit-pattern check that has no involvement of IEEE arithmetic.   We could be explicit and say that the function evaluation never raises a signal, if people don?t think that is already obvious. 

> 
>> 
>>> 
>>> If it explodes, should it safely return false?
>> What would be the reason to return false?
> 
> If it returns at all.  ;-)

If the argument is a NaN, certainly it is ?out of range? in the spirit of the intent of the function.  So it should return true (like the description in 16-007r2 says it does), not false.

Cheers,
Bill

> 
> --
> 
> Cheers!
> Dan Nagle
> 
> 
> 
> 
> _______________________________________________
> 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