cpts121-8-1

# cpts121-8-1 - CptS 121 Fall 09 Lecture 8-1 HK Chapter 7.1...

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

1 CptS 121 L8-1 – 10/12/09 Prof. Chris Hundhausen CptS 121 Fall ‘09 Lecture 8-1 HK Chapter 7.1 – 7.3: Data Types Lecture Outline I. Representation of numeric and char types II. Enumerated Types III. Quiz (on material covered last week)

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

View Full Document
2 CptS 121 L8-1 – 10/12/09 Prof. Chris Hundhausen Internal Representation of int and double As we already learned, int and double have different internal formats:
3 CptS 121 L8-1 – 10/12/09 Prof. Chris Hundhausen Internal Representation of int and double (cont.) C supports a variety of different integer formats: Type # bits in Microsoft  Visual C Short 16 unsigned short 16 int 32 unsigned int 32 long 32 unsigned long 32

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

View Full Document
4 CptS 121 L8-1 – 10/12/09 Prof. Chris Hundhausen Internal Representation of int and double (cont.) Likewise, C supports a variety of different double formats: Type # bits in Microsoft  Visual C float 32 double 64 long double 64
CptS 121 L8-1 – 10/12/09 Prof. Chris Hundhausen Internal Representation of int and double (cont.) Beware of round-off errors! Don't rely on two floating-point values being equal: for (trial = 0; trial != 10.0; trial += 0.1) { } Even the following may not execute the same number of times on all computers:

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 14

cpts121-8-1 - CptS 121 Fall 09 Lecture 8-1 HK Chapter 7.1...

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

View Full Document
Ask a homework question - tutors are online