<<< Rational numbers | Index | Rational number approximation >>> |
For example,
Rational(5,6) represents 5/6
Rational(5) represents 5/1
Rational numbers can be reduced to their lowest terms:
Rational(6,10) can be reduced to 3/5
Division by zero is obviously not allowed:
Rational(3,0) yields Zero Division Error at runtime.
<<< Rational numbers | Index | Rational number approximation >>> |