Boost logo

Boost :

Subject: Re: [boost] sorting floats by casting to integer
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2009-07-06 12:17:59


Steven Ross wrote:
> I think I've figured out what's going on with my 23-bit random data: floats
> on x86 have some form of optimization to look at the exponent first, and
> then the coefficient afterwards. On x86 systems, the comparison is
> extremely slow if the exponents are the same.

I still find that implausible.

> With 23-bit random data, all the exponents are the same.

You aren't setting all the exponents to zero are you? If you are then
I think you're generating de-normal values. The idea that comparing
de-normals is slow is plausible; it's the sort of thing that might be
done in microcode or in software on some systems.

(I've just noticed that Volodya has also suggested this explanation...)

Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk