Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: what did I just see..?

by BillKSmith (Monsignor)
on Mar 22, 2021 at 03:17 UTC ( #11130073=note: print w/replies, xml ) Need Help??

in reply to Re^2: what did I just see..?
in thread what did I just see..?

All your suggestions are true. My word 'seldom' probably does not apply to financial calculations. It may not be possible to exactly duplicate the calculations on the statement you receive from your financial institution. The printed decimal numbers on that statement are not exactly the same as the binary numbers in the bank's computer. It simply is not possible to recover every bit of those numbers. Any calculation that you do is flawed to start with. I have noticed that even Quicken's calculation of price/share never exactly agrees with my statement.

Replies are listed 'Best First'.
Re^4: what did I just see..?
by LanX (Sage) on Mar 22, 2021 at 04:01 UTC
    Financial calculations can be quite hairy AFAIK,

    And for very good reasons.

    They have special rounding rules and fixed precision like a tenth or hundreth of a cent.


    1 Euro = 1.95583 Deutsch Mark

    But it's all integer in nature.

    And bank rules may not be fiscal rules.

    The only way I can think of to handle such systems transparently in Perl is using objects with overloaded operators. (With internal integers)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2022-05-25 17:29 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (90 votes). Check out past polls.