Subject: surd.py From: Nick Seidenman To: python-list@cwi.nl Date: 04 May 1995 17:06:42 GMT X-Newsgroups: comp.lang.python X-Organization: Science Applications International Corporation On my way to developing a unitized number module I came up with this one for handling surds. Surd is an archaic term for rational number. This module provides a class and methods for manipulating surds by adding, subtracting, multiplying, dividing, exponentiating and other stuff. This will work with non-surds as well. There is a test driver at the end of the file that provides many examples of on how to use them. This is the first (released) cut and I'd appreciate constructive criticism. BTW, I know there is a Rat.py modue for doing this sort of thing, but a) I didn't find it 'til after I'd written this one, and b) mine is a litte more complete in terms of handling mixed (surd/non-surd) arithmetic as well as handling construction from floating point numerator/denominator. However, I did replace my GCD routine with Guido's - what a cool-a..ed language!!! nick