I'm trying to convert a 64 bit hexadecimal number to a float in PHP.
40F82C719999999A
If I run that in the IEEE-754 Floating-Point Conversion page at http://babbage.cs.qc.cuny.edu/IEEE-754.old/64bit.html it converts to:
99015.100000000000
Which is the number I'm looking for. But I can't get to this number in PHP. I've tried using various combinations of pack() and unpack() but I'm not anywhere close. :(
float
ordouble
representation? In other words, are you running a 32 ot 64 bit version of PHP? – Flosculus$binarydata64 = pack('H*','40F82C719999999A'); $float64 = unpack("d", $binarydata64);
– SyntaxError