![]() |
|
There's more than one way to do things | |
PerlMonks |
Re^4: Behaviour of int() unexpectedby cavac (Prior) |
on Mar 13, 2025 at 15:27 UTC ( [id://11164289]=note: print w/replies, xml ) | Need Help?? |
Number crunching in decimal is a waste of digital resources. Most of the time, yes. But there are certainly use cases, especially when using BCD (binary-coded decimal). When using very slow hardware, the tradeoff between using BCD and converting to/from binary can be significant, think battery powered digital watch. It's also quite useful when dealing with financial data and other "human math problems" (pocket calculators, etc). Yes, you still get rounding errors and stuff, but they are the rounding errors that humans expect in the decimal system we are used to (like on 10/3), not the ones binary calculation generate. Even the x86 architecture has (had?) very basic BCD support
PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP Also check out my sisters artwork and my weekly webcomics
In Section
Seekers of Perl Wisdom
|
|