Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Determining the minimum representable increment/decrement possible?

by davido (Cardinal)
on Jun 15, 2016 at 19:36 UTC ( [id://1165784]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Determining the minimum representable increment/decrement possible?
in thread Determining the minimum representable increment/decrement possible?

It would appear that in this case, 1.9041105342991887e+258 is not possible to store.

That is because 1.9041105342991887e+258 does not fit into m/2^n, and therefore cannot be represented precisely in base 2. You would need a couple more bits to push the rounding error further out, but that's just kicking the can down the road.

In other words, the binary representation of this floating point value results in a non-terminating sequence, much as 1/3rd results in a non-terminating sequence in base 10.


Dave

  • Comment on Re^4: Determining the minimum representable increment/decrement possible?
  • Download Code

Replies are listed 'Best First'.
Re^5: Determining the minimum representable increment/decrement possible?
by ExReg (Priest) on Jun 15, 2016 at 21:47 UTC

    Very true. But since perl is using double precision on my machine, you will never get that number. You would need quad precision to represent 1.9041105342991887e+258.

      Ignore this. I'm seeing things.


      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". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice. Not understood.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-24 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found