CPS 1 - Spring, 1997 - Ramm 2/10/97 #11

Chapter 2. Text Manipulation and Algorithm Design

Chapter 3. Numerical Computation and a Study of Functions

  • Data Types and Limitations
    • String
      • length limited to 255
      • any valid character is ok
    • Integer
      • limited size: 32767 thru -32768
        (details vary with machine & language)
      • whole numbers only (no fractions)
      • fixed granularity

  • New type: Real
    • large range of numbers,
      (details vary with machine & language)
    • varying granularity
    • handles fractions
      (analogous to scientific notation)
    • good for any everyday calculation;
    • also called floating point
    • (Note underneath is binary; therefore cannot represent all fractions exactly; can get rather close).

  • Operations on Reals
    • + , - , * , / (not div !)
    • < , > , = , <>
    • (watch out for what you mean by equal)

  • Programs using Reals
    volsphere.pas

  • Write Fahrenheit to Celsius Conversion Program
    • In Class
    • Table
    • Pretty I/O