Rational Numbers numerator denominator Exact representation of fractions A pair of integers As soon as division occurs,the exact representation may be lost!(Demo) Assume we can compose and decompose rational numbers: rational(n,d)returns a rational number x 6
Rational Numbers Exact representation of fractions A pair of integers As soon as division occurs, the exact representation may be lost! (Demo) Assume we can compose and decompose rational numbers: numerator denominator •rational(n, d) returns a rational number x 5
Rational Numbers numerator denominator Exact representation of fractions A pair of integers As soon as division occurs,the exact representation may be lost!(Demo) Assume we can compose and decompose rational numbers: rational(n,d)returns a rational number x numer(x)returns the numerator of x 6
Rational Numbers Exact representation of fractions A pair of integers As soon as division occurs, the exact representation may be lost! (Demo) Assume we can compose and decompose rational numbers: numerator denominator •rational(n, d) returns a rational number x •numer(x) returns the numerator of x 5
Rational Numbers numerator denominator Exact representation of fractions A pair of integers As soon as division occurs,the exact representation may be lost!(Demo) Assume we can compose and decompose rational numbers: rational(n,d)returns a rational number x numer(x)returns the numerator of x denom(x)returns the denominator of x
Rational Numbers Exact representation of fractions A pair of integers As soon as division occurs, the exact representation may be lost! (Demo) Assume we can compose and decompose rational numbers: numerator denominator •rational(n, d) returns a rational number x •numer(x) returns the numerator of x •denom(x) returns the denominator of x 5
Rational Numbers numerator denominator Exact representation of fractions A pair of integers As soon as division occurs,the exact representation may be lost!(Demo) Assume we can compose and decompose rational numbers: Constructor rational(n,d)returns a rational number x numer(x)returns the numerator of x denom(x)returns the denominator of x 77477444774444442
Rational Numbers Exact representation of fractions A pair of integers As soon as division occurs, the exact representation may be lost! (Demo) Assume we can compose and decompose rational numbers: numerator denominator •rational(n, d) returns a rational number x •numer(x) returns the numerator of x •denom(x) returns the denominator of x Constructor 5
Rational Numbers numerator denominator Exact representation of fractions A pair of integers As soon as division occurs,the exact representation may be lost!(Demo) Assume we can compose and decompose rational numbers: Constructor rational(n,d)returns a rational number x ●numer(x) returns the numerator of x Selectors ●:denom(x):returns the denominator of x
Rational Numbers Exact representation of fractions A pair of integers As soon as division occurs, the exact representation may be lost! (Demo) Assume we can compose and decompose rational numbers: numerator denominator •rational(n, d) returns a rational number x •numer(x) returns the numerator of x •denom(x) returns the denominator of x Constructor Selectors 5