From: Clifford Heath Date: 2003-02-06T10:09:19+09:00 Subject: Re: a cute way to reduce a fraction? If you hadn't already factorized them (or even perhaps if you have!), you're better off computing the gcd of numerator and demoninator and dividing if not 1. gcd is very fast. I had to do fractional arithmetic for an integer 2-d graphics package once, and needed to find fractional approximations that wouldn't cause integer overflow during transform. There's a surprisingly easy algorithm for computing a fractional approximation for a real number to within an allowed error margin, I'll look it up if anyone's interested. I just iterated the algorithm until the approximation generated a numerator that was too large, then used the previous fraction. All a bit pointless now, actually slower than using floating point because the integer unit is tied up with fractions and can't do the other things (array indexing etc) if needs to do. Clifford.