Is there a function that can cancel down fractions as far as they go, and then return the denominator and the numerator as separate integers?

Printable View

- 05-13-2005Finchie_88Cancelling down of fractions
Is there a function that can cancel down fractions as far as they go, and then return the denominator and the numerator as separate integers?

- 05-13-2005Salem
Something along these lines?

http://www.google.com/search?q=great...on+denominator - 05-14-2005Finchie_88
yer, that kind of thing, but I was wondering if there was a specialised function for it or whether I would have to write my own function for it.

- 05-14-2005Salem
a/b reduces to a/gcd(a,b) / b/gcd(a,b)

Yes, you have to write gcd() for yourself (or find it).

Neither of which is particularly hard. - 05-15-2005treenef
Search the post for 'fractions'. That should give you some ideas.