Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Float/double to hex?

by BrowserUk (Pope)
on Feb 18, 2013 at 01:27 UTC ( #1019256=note: print w/ replies, xml ) Need Help??


in reply to Float/double to hex?

1 / 7 = 0.142857142857143 = 0x6FDF1234

That hex value doesn't correspond to either a float or double in IEEE format?

print unpack 'h*', pack 'f', 1/7;; 529421e3 print unpack 'h*', pack 'd', 1/7;; 2942942942942cf3

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Float/double to hex?
Download Code
Replies are listed 'Best First'.
Re^2: Float/double to hex?
by Anonymous Monk on Feb 18, 2013 at 01:35 UTC

      I've no idea what that hex value is, but it certainly isn't any IEEE representation of 1/7.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
      HA! I completely got fooled by wolfraudalpha

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019256]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2015-07-30 11:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls