|
bit_logic > Concepts > Signed Integrals
Signed IntegralsSigned integral representation is not defined by the C++ Standard ( Sect 3.9.1 "Fundamental Type"), other than to say :
This definition allows for 3 different binary representations of negative numbers. Positive numbers have a guaranteed binary representation, but their negative counterparts are implementation dependent. To handle how we encode these bits in a Bit Container, we have 3 template selector classes, which can be used as template arguments to the packing / unpacking functions. These are :
Without using the selector class version the default binary encoding for a negative signed value is "2's complement". The native integral representation is defaulted to be "2's complement", but to override you need to use a define before including andy Bit Logic libraries. If there is a more "boost" like way to do this please tell me . Defines are :
|