Boost logo

Boost :

Subject: Re: [boost] [config/multiprecision/units/general] Do we have a policy for user-defined-literals?
From: John Maddock (john_at_[hidden])
Date: 2013-04-28 08:55:17

>If I ever get my behind in gear on the radix-2
>floating-point backend, do you think it potentially
>be used there in combination with constexpr as well?

Floating point is tough because you have the exponent to deal with.

For integers it's simply:

* Accept a sequence of 4-bit values (the hex bytes).
* Shuffle the 4-bit value sequence into a limb-bit value sequence.
* Initialise your array of limbs with the sequence.

Once you get your head around what you're trying to do, there's actually
very little code involved at all :-)

That said, I don't see why it couldn't be done for hexadecimal floating
point constants - at least in princpal!

Decimal conversion would be next to impossible because you'd need a complete
compile-time-arbitary-precision-arithmetic library :-(

Cheers, John.

Boost list run by bdawes at, gregod at, cpdaniel at, john at