News for hackers. Stuff that matters.
Re:Solutions to Integer Overflow by SamReidHughes on Saturday September 03, 2016 @02:03PM (#12420268)
> Using bignums means that arithmetic operations would have to check their arguments for whether they're bignums and also check the result for overflow,

This is a bit thoughtless because you could code generate two parallel sides of a function -- one where everything is a small-value and you only need to check for overflow after the fact, and one where some values are big-values. The small-value side of the function then jumps to the big-value side once an overflow happens. The only overhead on the small-value side is that after calling a function that returns a bignum, the return value has to be tested to confirm that it's a small-value. Functions can also have separate entry points for when all parameters are known to be a small-value, versus when they're not.

There are no comments on this comment yet.