Irrational number representation in any programming language?
问题 Does anyone know of an irrational number representation type/object/class/whatever in any programming language? All suggestions welcome. Simply put, if I have two irrational objects, both representing the square root of five, and I multiply those objects, I want to get back the integer five, not float 4 point lots o' 9s. Specifically, I need the representation to be able to collect terms, not just resolve every time to an integer/float. For instance, if I want to add the square root of five