Lectures Floats
Real vs floating limits
  Number line

  

  Real number can represent any value.

  Real numbers limited by writing fatigue.

  Often symbolically represented to avoid writing.
    Fractions or rational (ratio) numbers   1/3
                                        -
    Special notation for irrationals .333, pi, e - Euler's number

    Rounding  .6666667  - we decide precision
      precision vs. accuracy

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

      Addition (adjust exponent to equal each other and sum coefficients)

      Multiplication (multiply coefficient and sum exponents)

In computers, numbers limited by available storage
  and standarded schema handling representation.

Problem: Where is the decimal point?

  • Fixed point. Partial solution. Fixed point defines total number of digits and the location of decimal point, 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 aligned Integer and fractional portions handled by separate routines. All values of a similar magnitude. Most common in monetary systems. Inexact values handled with well defined rounding rules.
  • Stored in a form derived from scientific notation. Advantage of representing floats in scientific notation format. 734 = 7.34 * 10^2 .0035316 = 3.5316 * 10^-3 All numbers are represented by an exponent and a set of significant digits, variously called coefficient, mantissa, or significand. In the form d.dddd x 10^y This provides a fixed point (from the left) representation. Tends to make addition harder but multiplication easier. Base 10 1 integer (1-9), n decimal digits(0-9) and signed power of 10 Base 2 1 integer (1), n binary digits and biased signed power of 2 Early systems used custom formats when assigning number of bits for the significand and the exponent. Requiring extra work when transferring data to another system. IEEE 754 - common standard for storing real values. Institute of Electrical and Electronics Engineers. Last update IEEE 754-2008 (ISO/IEC/IEEE 60559:2011) international adaptation of IEEE 754