quote:Original post by a person
does it matter if ints are a fixed size? if you compile with 16bit or 32bit ints, in both instances it will be consistent. (ie all ints compiled on a 16bit compiler are 16bit). this is a reason you dont use int, and you use short and long.
Er, that''s exactly the point. If you had a BigNumber implementation, they wouldn''t all be the same size. That''s what I mean by "''int'' would no longer be a fixed size". Its size would depend on the value being stored.
quote:msbset
1<<((sizeof(x)<<3)-1)
Not safe.
sizeof(char) is not guaranteed to be 8. Don''t shift left by three, multiply by CHAR_BIT (I think it''s limit.h or something that it''s defined in).
quote:And zero is *positive*
Zero is neither. But a number of encoding schemes for numbers have distinct representations for "zero approached from below" and "zero approached from above". One''s complement, signed magnitude, and IEEE floating point numbers all have this attribute.