Alan Falloon wrote:
> If we assume IEEE floating point format, then they can be compared as
> integers. See the section "Comparing using integers" in
> http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
As the above link notes, since integers on most machines are
twos-complement and not sign-magnitude, it doesn't work right for
negative floats.
Working around this isn't possible without knowing it's actually a float
(in which case a floating point compare could just be used, anyhow).