(j3.2006) Question about IEEE assignment and derived types

Dick Hendrickson dick.hendrickson
Fri Dec 14 15:40:58 EST 2007


Bill Long wrote:
> 
> Dick Hendrickson wrote:
>> This is a multi-part question and everything depends on the
>> answer to the first question.  If that is NO, then everything
>> that follows isn't interesting.
>>
>> 1)  It's my understanding that IEEE conformance requires raising
>> an exception whenever a NaN is used (assuming that the correct
>> IEEE modules are used and that enough IEEE_SET routines have
>> been called).  If so, does this mean that
>>         A = B
>> must raise an exception if B is a NaN?
>>   
> No.  Assignment is not an "operation" and the IEEE standard explicitly 
> says that raising an exception in this case in not required. 


I found the IEEE standard on the J3 site and read part of it.  It
looks to me like it is an implementation option whether or not
the load/store of a signaling NaN raises a signal is processor
dependent.

Does that make the answer to all 5 questions "processor dependent"?
That doesn't seem very user friendly for the 4) and 5) unusual
cases.  (And, yes, I meant to say signaling NaN in the original
post, sorry.)

Dick
> 
> Cheers,
> Bill
> 
> 
> 
>> If NO, hit the delete key now!
>>
>> 2)  Then obviously
>>         C%E = D%E
>> must raise an exception if C and D are of a type that has a real
>> component and D%E is a NaN.
>>
>> 3)  Again, then obviously
>>         C = D
>> must raise an exception if intrinsic assignment is used and
>> D%E is still a NaN
>>
>> 4)  How about if defined assignment is used?  The defined
>> assignment section (12.4.3.4.3) says C=D is equivalent to
>>       CALL USER_SUB (C, (D))
>> 12.5.4 says that the argument expression, (D), is evaluated.
>> Does that mean that an exception must be raised on the calling
>> side?  Can't be raised, or is it processor dependent?
>> Can the expression be evaluated without using the value of
>> its elements?
>>
>> 5)  How about allocation with a source = term.
>>      ALLOCATE (C, SOURCE = D)
>> 6.6.1.2 says the value of C "becomes" that of D.  Again,
>> should an exception be raised if D%E is a NaN?
>>
>> Dick Hendrickson
>> _______________________________________________
>> J3 mailing list
>> J3 at j3-fortran.org
>> http://j3-fortran.org/mailman/listinfo/j3
>>   
> 




More information about the J3 mailing list