private function floatToIEEE($floatInt)
{
$floatInt = (double) $floatInt;
$binInt = pack('f', $floatInt);
$hexInt = '';
for ($i = 0; $i < strlen($binInt); ++$i) {
$c = ord($binInt[$i]);
$hexInt = sprintf('%02X', $c) . $hexInt;
}
if ($floatInt < 0) {
$binIntString = decbin(hexdec($hexInt));
$twoComplement = '';
for ($i = 0; $i < strlen($binIntString); ++$i) {
if ($binIntString[$i] == '0') {
$twoComplement .= '1';
} else {
$twoComplement .= '0';
}
}
return -(bindec($twoComplement) + 1);
} else {
return hexdec($hexInt);
}
}