20091120-Primitives-II

# 20091120-Primitives-II - CSE115: Introduction to Computer...

This preview shows pages 1–5. Sign up to view the full content.

CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739 [email protected]

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Agenda Today: Signed integral types •two’s complement representation
int values: 0, 1, -1, 2, - 2, … maximum int: 2147483647 = +2 (32-1) -1 minimum int: -2147483648 = -2 (32-1) operations: + - * / % 5+2 = 7 +: (int,int) int 5-2 = 3 -: (int,int) int 5*2 = 10 *: (int,int) int 5/2 = 2 (quotient) /: (int,int) int 5%2 = 1 (remainder) %: (int,int) int

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
representation used differs according to whether type is signed (byte, short, int, long) or unsigned (char): – signed integral values are represented using “two’s complement” representation – unsigned integral values are represented using “binary” representation size of representation differs according to type: byte is 1 byte wide (1 byte = 8 bits) short is 2 bytes wide int is 4 bytes wide long is 8 bytes wide
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/13/2011 for the course CSE 115 taught by Professor Decker during the Fall '08 term at SUNY Buffalo.

### Page1 / 13

20091120-Primitives-II - CSE115: Introduction to Computer...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online