Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Is there a better way to call fe(get|set)round?

by BrowserUk (Patriarch)
on Jul 02, 2007 at 13:26 UTC ( [id://624436]=note: print w/replies, xml ) Need Help??


in reply to Re: Is there a better way to call fe(get|set)round?
in thread Is there a better way to call fe(get|set)round?

You missed the point again. The rounding mode being queried or altered by the OP, is that of the math coprocessor and is applied to the results of all FP operations done by it. The 4 modes are as defined by the IEEE Floating Point standard. The two calls, fe(get|set)round are C/C++ compiler provided functions to get/set that hardware rounding mode.

Moving to using software emulated, infinite precision FP to achieve the same end would for most applications be a disaster. With Math::BigFloat, FP calculations run anything from a few hundred to a few 10s of thousands times more slowly depending upon the configuration and underlying libraries used. Okay if your calculating the final cost of a few dozen items in an IO bound shopiing cart application, but for any kind of serious math, way too slow.


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^2: Is there a better way to call fe(get|set)round?

Replies are listed 'Best First'.
Re^3: Is there a better way to call fe(get|set)round?
by HollyKing (Pilgrim) on Jul 04, 2007 at 18:56 UTC
    Yes, exactly. Thanks!

    Owl looked at him, and wondered whether to push him off the tree; but, feeling that he could always do it afterwards, he tried once more to find out what they were talking about.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-23 19:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found