Dump special floating point operators

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Dec 3 14:05:33 PST 2009


Walter Bright wrote:
> !<>=
> <>
> <>=
> !<=
> !<
> !>=
> !>
> !>=
> 
> http://www.digitalmars.com/d/2.0/expression.html#RelExpression
> 
> While I like them a lot, it's time for them to go:
> 
> 1. It's hard to remember which one does what
> 2. They've failed to catch on
> 3. No operator overloading for them
> 4. They are only rarely needed; a special operator is not justified

(per our discussion)

5. a peephole optimization can detect isnan(a) || a < b and have it 
translate into one instruction, same as a !>= b, thus addressing the 
efficiency problem that the FP operators were meant to solve.

Peephole optimizations have a precedent:

c = a / b;
d = a % b;

only use one division-and-remainder instruction.


Andrei



More information about the Digitalmars-d mailing list