next up previous
Next: Arbitrary-precision floats Up: Variable precisions Previous: Variable precisions

Rational

Exact rational arithmetic (1/2+1/3 = 5/6) is available in ``computer algebra systems'' (CAS) like Mathematica, Maple, Macsyma, and a dozen less well-known systems. Rationals don't solve 0/0 problems, but over/underflow, and inexact cannot happen under algebraic operations. But slow, and not closed under elementary functions. But one could convert any ordinary float to an exact rational number: fraction * power of two, and compute +, *, / EXACTLY!

This is usually not considered practical because of inefficiency, but such tools can be used to prove mathematics computationally.



Richard J. Fateman
Thu Aug 13 21:54:23 PDT 1998