in reply to Re: Float/double to hex?
in thread Float/double to hex?
Well, FWIW, https://www.wolframalpha.com/input/?i=1%20%2F%207%20%3D%200.142857142857143%20%3D%200x6FDF1234 seems to poop it out just fine
I figure it is https://en.wikipedia.org/wiki/Single-precision_floating-point_format but I can't get it correct
I can get https://en.wikipedia.org/wiki/Single-precision_floating-point_format#Single-precision_examples on my machine (3eaa aaab ≈ 1/3) with
but basically I tired brute forced it :)$ perl -le " print unpack 'H*', pack 'f>', 1/3 3eaaaaab
I also saw these and they might have something to do with it, but the bits got me :) Network IEEE 754 to Native Floats: which pack/unpack ops better?, Extracting IEEE 754 floating point numbers
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Float/double to hex?
by BrowserUk (Patriarch) on Feb 18, 2013 at 01:56 UTC | |
Re^3: Float/double to hex?
by Anonymous Monk on Feb 18, 2013 at 01:37 UTC | |
Re^3: Float/double to hex?
by Mr. Muskrat (Canon) on Feb 18, 2013 at 18:21 UTC |
In Section
Seekers of Perl Wisdom