Why don't we store fractions as fractions rather than floating point?
Common Lisp does by default. Calling (/ 1 3) gives 1/3 which is a rational. The individual components of a rational number are bignums, so the size of the fraction is only limited to available RAM. However, this is not enough in many cases. For example, how would you store pi? In the case of Lisp, pi is stored as a floating point number, and the conversion rules say that a mathematical operation between a rational an…
how would you store pi?
same way we do now I guess? Approximate it. My vote is on 22 / 7