
29 Apr
2013
29 Apr
'13
8:40 a.m.
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).