How to detect encodings on signed integers in C? -
How to detect encodings on signed integers in C? -
the iso c standard allows 3 encoding methods signed integers: two's complement, one's complement , sign/magnitude.
what's efficient or way observe encoding @ runtime (or other time if there's improve solution)? want know can optimise bignum library different possibilities.
i plan on calculating , storing in variable each time programme runs doesn't have blindingly fast - i'm assuming encoding won't alter during programme run :-)
you have check low order bits of constant -1
-1 & 3
. evaluates
this should possible in preprocessor look within #if #else
constructs.
c signed twos-complement ones-complement
Comments
Post a Comment