IsRat returns true if obj , which can be an arbitrary object, is a rational and false otherwise. Integers are rationals with denominator 1, thus IsRat returns true for integers. IsRat will signal an error if obj is an unbound variable or a procedure call. Because the numerator holds the sign of the rational it may be any integer. Integers are rationals with denominator 1, thus Numerator is the identity function for integers.
Denominator returns the denominator of the rational rat .
Because the numerator holds the sign of the rational the denominator is always a positive integer. Integers are rationals with the denominator 1, thus Denominator returns 1 for integers. The inequality operator evaluates to true if the two rationals q1 and q2 are not equal and to false otherwise. This definition is of course only valid because the denominator of rationals is always defined to be positive. This definition also extends to the comparison of rationals with integers, which are interpreted as rationals with denominator 1.