Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBacterius

Posted 07 February 2013 - 06:55 PM

 

If you include the standard header , C++ defines alot of integer types that are more specific:
int8_t = -127 to +127

 

Actually int8_t is =-128 to 127 

 

Whoops, you're right. No point wasting a space for -0 is there? laugh.png

Having a negative zero could also introduce the need for different hardware paths for signed and unsigned arithmetic. One major advantage of two's complement notation is that signed and unsigned are exactly the same at hardware level. For addition, subtraction, and multiplication, anyway.


#1Bacterius

Posted 07 February 2013 - 06:54 PM

 

If you include the standard header , C++ defines alot of integer types that are more specific:
int8_t = -127 to +127

 

Actually int8_t is =-128 to 127 

 

Whoops, you're right. No point wasting a space for -0 is there? laugh.png

Having a negative zero would also introduce the need for different hardware paths for signed and unsigned arithmetic. One major advantage of two's complement notation is that signed and unsigned are exactly the same at hardware level. For addition, subtraction, and multiplication, anyway.


PARTNERS