All pastes #483069 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-11 15:32 UTC
rendered paste body
Fast functions for which give the sign of a 32 bit floating point number by checking the sign bit. There are two versions, one which gives the value as a float, and the other gives an int.

The _nozero versions are faster, but they they give incorrect 1 or -1 for zero (depending on the sign bit set in the number). The int version should be faster than the Tobybear one in the archive, since this one doesn't have an addition, just bit operations.