On Jul 1, 1:01pm, Dr W.W. Schulz wrote:
> Subject: Re: operator( == ) and its negation
> I asked:
>
> >> Is there a fundamental reason not to define A/=B automatically
> >> as .not.(A==B)? Or is that just a bloody oversight that will take
> >> years to make it into the standard?
> <snip>
>
> Richard Shapiro wrote:
>
> > Yes, it's not true. Consider if A and B are IEEE reals, and A is NaN.
> > A==B is false, and so is A/=B. It's not hard to imagine a derived type with
> > a similar property.
>
> But here one of the variables (or expressions) have an illegal value for
> the operation in question. ...
Huh? NaN is a perfectly legal value. The point is that there is
no fundamental rule that exctly one of A==B and A/=B must be true, nor,
in most peoples' opinion, should there be. If it is true for your
defined types, then code it that way.
-P.
--
*********** How can we have ethnic music without ethnic hatred? ***********
* Peter S. Shenkin; Chemistry, Columbia U.; 3000 Broadway, Mail Code 3153 *
** NY, NY 10027; [log in to unmask]; (212)854-5143; FAX: 678-9039 ***
*MacroModel WWW page: http://www.columbia.edu/cu/chemistry/mmod/mmod.html *
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|