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

Bill Long longb
Fri Dec 14 12:31:24 EST 2007

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. 


> 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 ( 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.
> 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

Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120


More information about the J3 mailing list