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

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

View Full Document Right Arrow Icon
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)
Background image of page 1

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

View Full DocumentRight Arrow Icon
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:
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
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:
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online