Boost logo

Boost :

Subject: Re: [boost] [xint] Question about suitability, portability, and "Boostiness"
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2010-04-13 02:03:46


On 13 April 2010 01:55, Chad Nelson <chad.thecomfychair_at_[hidden]> 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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk