Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^6: Behaviour of int() unexpected

by LanX (Saint)
on Mar 13, 2025 at 03:30 UTC ( [id://11164284]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Behaviour of int() unexpected
in thread Behaviour of int() unexpected

> data type for fractions.

I should have mentioned that any periodic number can be represented loss free as fraction, and vice versa.

(I already covered this in school in 7th or 8th grade but curriculums may vary.)

So, within the boundaries of integer precision you can have loss free calculations.

But with some overhead for normalization. (I suppose they can't be delayed ...🤔 ;)

This could be sufficient for financial applications, though I'd rather prefer to calculate with the smallest unit in integer. ( Like cent, or deci-cent or whatever depending on legal specifications)

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2026-04-10 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.