
13 Apr
2010
13 Apr
'10
6:03 a.m.
On 13 April 2010 01:55, Chad Nelson <chad.thecomfychair@gmail.com> wrote:
And in exchange, every function in the library that uses the internals of the integer -- and there are several -- would need to have special-case handling for small numbers. Not worth the trade-off.
And don't they already need it for your "quick digits"? Also, if you're allowing special values like NaNs, you already have the check, and can even store the bit marking the special value in the small variable. if (small & 1) if (small & 2) then special value type (small >> 2) else sbo value, value (small >> 2) else full-length value in *ptr somewhere You've just moved the NaN check before the pointer chase, so it's potentially faster.