Boost logo

Boost :

Subject: Re: [boost] [Boost.FixedPoint] Choose notation
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2013-04-29 04:40:28


On 4/29/2013 3:03 AM, John Maddock wrote:
>> If you absolutely needed an 8.4 type then you need fixed-width integer
>> support beyond that provided by <cstdint>. You could provide an
>> implementation of integer<12> that is a 12 bit integer and then make
>> fixed<integer<12>,4>. In my opinion this is another library outside
>> the scope of a fixed-point library.
>
> Can I just point out that the multiprecision lib will do a 12-bit int
> type if that's what you want:
>
> typedef number<cpp_int<12, 12, unsigned_magnitude, unchecked, void> >
> my_int12_t;
>

Nice.

> Of course the signed version is signed-magnitude not 2's complement....
>

Shame, interop with libraries like OpenGL ES would require 2s complement
(signed 16.16).


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