Dump special floating point operators

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Dec 3 18:36:19 PST 2009


ZY.Zhou wrote:
> Andrei Alexandrescu Wrote:
>> a peephole optimization can detect isnan(a) || a < b and have it 
>> translate into one instruction, same as a !>= b,
> 
> I think most people would use !(a>=b) rather than  isnan(a) || isnan(b) || a < b

Sorry. So a !>= b is indeed semantically equivalent with isnan(a) || 
isnan(b) || a < b. However, if I read the table at 
http://www.digitalmars.com/d/2.0/expression.html#RelExpression 
correctly, !(a >= b) would throw if either is NaN.


Andrei



More information about the Digitalmars-d mailing list