|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re^6: Behaviour of int() unexpectedby LanX (Saint) |
| on Mar 13, 2025 at 03:30 UTC ( [id://11164284]=note: print w/replies, xml ) | Need Help?? |
|
> 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
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||