You will have to look up
the JLS specification for floating-point numbers, and also the IEEE754 standard. There is a description in hardware books, for example I have
Alan Clements:
the Principles of Computer Hardware (3/e), Oxford: Oxford University Press (2000), page 187-189.
For normalised
double numbers, you get
Sign bit: 1 bit.Binary exponent, biased by 1023: 11 bits.Mantissa: 53 bits.Total: 65 bits. That is done by normalising the mantissa so it always lies in the range 1.00000000000000etc...1.111111111111etc and discarding the 1. So you get 53 bits into 52 bits worth of space and can still fit it into 64 bits. So your mask with 0x000ffffffffffffL will have to become
The () are not strictly necessary. You would then have to convert it back to a double using OR with (I think) 0x3ff0000000000000L.
Maybe logs are easier.
[ June 19, 2008: Message edited by: Campbell Ritchie ]