Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

by BrowserUk (Pope)
on Jul 02, 2007 at 13:26 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://624436]
Discipulus there are none so deaf as those who will not hear..
Discipulus who do not want to ear
[Corion]: marto: No, I haven't seen anything either and I'm not sure if learning-by- osmosis will work here
[marto]: I've experienced the behavior LanX described, outsourcing really opens your eyes to the situation :)
[Discipulus]: ;=)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-03-30 07:08 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (353 votes). Check out past polls.