// assume we have 52 bits of data, little endian.
$bytes = "\x12\x34\x56\x78\x9a\xbc\x0d\x00";
// ^ ^^ 12 bits of padding.
$parts =
unpack('V2',
$bytes);
$theNumber =
$parts[1] +
pow(2.0,
32) *
$parts[2];
// <-- this is precise. $theNumber /=
pow(2.0,
52);
// <-- this is precise.