Looking at the IEEE float/double representation
[mantissa sign][signed exponent][unsigned mantissa]
Am I correct to assume that sorting these values numerically always results in the same as sorting the bit patterns themselves lexicographically?
My other question then is how do I obtain the bits (or rather bytes) of the bit pattern (of the IEEE representation) of a float/double in Java? (Or alternatively just on the HotSpot JVM, if the internal representation isn't specified.)
How would I construct an IEEE-like representation for arbitrary-precision Decimals (like java.math.BigDecimal
)?