WTF ?

Nicholas Clark nick at ccl4.org
Mon Jan 15 10:55:31 GMT 2007


On Sun, Jan 14, 2007 at 08:28:25PM +0000, Daniel Barlow wrote:

> How much slower could it be to do the maths with machine words then
> check the overflow flag and recompute if it flipped?  More or less slow

Floats don't overflow in that sense.

I know of no easy way to determine efficiently if for a given value or pair
of values an operation will result in loss of precision.

The only way I can think of doing it is to forgo floating point hardware
completely and code all operations longhand in integer operations. There
may be better ways, but I'd be surprised if they were fast.

Nicholas Clark


More information about the london.pm mailing list