Stores the numerator, denominator, and value of a ratio as a single object.
Three objects belonging to the same class.
Logical. Whether to check that
the objects are
"rat" is a simple mechanism for keeping track of
the numerator and denominator when calculating a ratio. Its main
purpose is simply to signal that the object is a ratio.
rat creates an object of class
given the numerator, the denominator and the ratio.
No calculation is performed;
the three objects are simply stored together.
can be objects of any kind. They should belong to the same class.
It is assumed that the relationship
ratio = numerator/denominator
holds in some version of arithmetic. However, no calculation is performed.
By default the algorithm checks
whether the three arguments
denominator are compatible objects, according to
The result is equivalent to
ratio except for the
addition of extra information.
An object equivalent to the object
except that it also belongs to the class
and has additional attributes