A rational number in our representation consists of the numerator and the denominator. ICE provides price information using numerators only. To get a real price, get the denominator from a product definition and divide the numerator by the denominator. To simplify this, we decided to use our own representation and always keep the denominator together with the numerator.
For more details, please see Rational.
We support only limited operations for rational numbers. There are no arithmetic operations for this class at all. You can only use the following:
If you want to perform basic arithmetic on rational numbers, use numerators only and make sure the denominators match. For example, to add two prices represented as rational numbers, create a rational number whose numerator equals the sum of numerators while keeping the denominator the same:
\[ \frac{1}{100} + \frac{2}{100} = \frac{1 + 2}{100} = \frac{3}{100} \]