Eliminate the baroque floating-point operators a la !<>=

Lionello Lunesu lio at lunesu.remove.com
Mon May 18 08:11:07 PDT 2009


>   a <> b

It's an old wish of mine that this be used for the invocation of opCmp 
(instead of opEquals), returning an int, and valid for 
struct/class/built-ins/etc...  (like perl's <=>, I think)

As for the other operators, I never used them and I don't think I would 
use them ever often enough to remember what operator had what function. 
Using isNan sure is more clear and therefor safer :)

As per Don's comment, the compiler would just have to remember that 
after a comparison the NaN flag is still correctly set and any isNan() 
could simply be skipped, resulting in only an additional branch instruction!

L.




More information about the Digitalmars-d mailing list