Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: IEEE-754 calculation - best way?

by Illuminatus (Curate)
on Jan 30, 2013 at 22:31 UTC ( #1016167=note: print w/ replies, xml ) Need Help??


in reply to IEEE-754 calculation - best way?

This is really 2 questions

  1. How do I calculate values all adhering to IEEE-754?
  2. How do I display an IEEE-754 value accurately?
Perl uses double or long double as its internal data format, depending on how it's built. It's going to do 754-compliant calculations.

The only way you can control how the value is displayed is via a mechanism that allows you to specify what you want. Things like printf/fprintf/sprintf (or something like Number::Format).

fnord


Comment on Re: IEEE-754 calculation - best way?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2015-07-29 22:24 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 (269 votes), past polls