3 ms·
Arbitrary precision integers aren't necessarily that expensive to implement. It does require overflow checking for operations on regular fixed integers, and ke
by retrac 3y ago
Arbitrary precision integers aren't necessarily that expensive to implement. It does require overflow checking for operations on regular fixed integers, and keeping track of type, but if you're doing that anyway (many languages are) then it's almost free; the bignum code only runs when it doesn't fit in a fixed integer. Common Lisp, Python, Haskell use big integers for all integers, too. And others, I'm sure. It can be optimized away by a compiler to just fixed integers, sometimes.
- hayley-patton 3y ago> It can be optimized away by a compiler to just fixed integers, sometimes Yep, SBCL does range analysis and can do inline fixnum or unboxed arithmetic.
- rscho 3y agoRacket/Chez Scheme can too :-)