in reply to Re^3: Behaviour of int() unexpected
in thread Behaviour of int() unexpected
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Behaviour of int() unexpected
by LanX (Saint) on Mar 13, 2025 at 20:25 UTC | |
by cavac (Prior) on Mar 14, 2025 at 07:36 UTC |