Real vs floating limits
  Real number can represent any value.
     Addition vs. multiplication

  Real numbers limited by writing fatigue.

  Often symbolically represented to avoid writing.
    Fractions 1/3
                        -
    Special notation .333, pi, e

    Scientific notation for extreme ranges of values
        6.02*10^23  or  1.00 * 10^-16


In computers, numbers limited by available storage and need to standardize
  storage and handling of representation.

Problem: Where is the decimal point?

  • Fixed point. Partial solution. Fixed point defines the location of decimal point and number of digits to the right of number. Most often implemented in software. Often used in conjunction with BCD format. By fixing decimal point Digits can be alligned Integer and fractional portions handled by separate routines. All values must be of a similar maginitude. Most common in monetary systems. Inexact values handled with very predictable rounding rules.
  • Stored in a form derived from scientific notation. Base 10 1 integer (1-9), x decimal digits(0-9) and signed power of 10 Base 2 1 integer (1), x binary digits and biased signed power of 2 Early systems used custom formats and not easily transferred. IEEE 754 - common standard for storing real values. Floating point limitations Greater range of magnitudes can be represented by same system. IEEE 754 standard 2 storage formats 32 bit (single), 64 bit (double) Custom software can still use its own standard for extreme precision. Number line representing float limitations. Numbers, both +/-, too large in magnitude for given storage. Known as overflow. Numbers, both +/-, too small in magnitude to represent. Known as underflow. In some cases, may be assumed to be zero Numbers that cannot be exactly represented in binary. 1/3 Pi Zero representation. IEEE 754 uses a variation of scientific or exponent notation. By definition, zero cannot be expressed in scientific notations Therefore Float requires special represent to specify true zero. Issues of precision - using fixed point storage of 8.8 bits (16 bits) to represent .431
    Decimal.Decimal to binary
      .431
      0.862 c 0
      1.724 c 1
      1.448 c 1
      0.896 c 0
      1.792 c 1
      1.584 c 1
      1.168 c 1
      0.336 c 0
       
    Binary to Decimal.Decimal
      0.01101110
      0 * .5 + 0.0
      1 * .25 + 0
      1 * .125 + 0.25
      0 * .0625 + 0.375
      1 * .03125 + 0.40625
      1 * .015625 + 0.421875
      1 * .0078125 + 0.4296875
      0 * .00390625 + 0.4296875
      0.4296875
    Note the difference between values
    0.431 - 0.4296875 = .0013125