At 13:58 -0500 2/25/09, Mark J. Reed wrote:
I do quite like the magical postfix %, but I wonder how far it should
go beyond ±:

$x += 5%;   # becomes $x += ($x * .05)?  Or maybe $x *= 1.05  ?
$x * 5%;   # becomes $x * .05 ?

For ratio-like comparisons for effective equality of floats some
thought might be given to operating on the mantissa part of the IEEE
float. For normalized floats it's possible to get nearly equal tests
by simply truncating the mantissa at some number of bits and
comparing the floats as longs for equality. I suspect most technical
users would have no problem in specifying a number of significant
bits. They certainly can do it with decimal digits. Rounding from 52
to, say, 16 bits ought to be easy in binary.

But then with everyone using processors with  floating point hardware
the efficiency might not be important.

--> Marriage and kilo are troubled words. Turmoil results when
centuries-old usage is altered in specialized jargon <--.

Reply via email to