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

Re: Proper monetary rounding

by jonadab (Parson)
on Mar 06, 2007 at 16:29 UTC ( #603450=note: print w/replies, xml ) Need Help??


in reply to Re^2: Proper monetary rounding
in thread Proper monetary rounding

Are you sure that's sprintf behaviour, or is there a limitation in the IEEE floating point representation of 1.5050 that has it leaning on the low side of 0.0050?

I'm not personally sure of any of this, no. As far as I know it could depend on the C compiler perl was compiled with, the C library it was compiled against, and the day of the week it was compiled. I was just asking how the other poster's explanation of sprintf's behavior differed from the desired rounding behavior.

On closer inspection, I think I see a difference I didn't notice before, though.

-- 
We're working on a six-year set of freely redistributable Vacation Bible School materials.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603450]
help
Chatterbox?
[1nickt]: Morning monks, howzit?
[ambrus]: AAAAAAARGH!
[ambrus]: something must be wrong here
[ambrus]: oh I see. I'm stupid
[marto]: hi 1nickt!
[ambrus]: The file I'm reading is already filtered, which is why I found only one kind of entry.
[1nickt]: Sorry to upset you brother Ambrus ...
[1nickt]: Ah not me, good!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-01-23 13:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (246 votes). Check out past polls.

    Notices?