in reply to Fraction Cancelation

What is your purpose? How many numbers do you have on both numerator and denominator sides? How large would the numerator and the denominator be if you just made all the multiplications for both? Do you need absolutely accurate integer arithmetic, or would you be happy enough with a (presumably fairly close) floating-point approximation?

I am asking all these questions because the best strategy would probably depend on the answers to at least some of these questions. The "shape" of the data is especially important in such cases.

Update: fixed a typo ('numerator' instead of 'denominator' in one place).

Replies are listed 'Best First'.
Re^2: Fraction Cancelation
by baxy77bax (Deacon) on Feb 25, 2016 at 11:52 UTC
    Hi,

    1. well the numbers are in range of 1-10 thousand (x).
    2. well very large with O(x!) being some upper limit (for both numerator and denumerator) but final coefficient is ought to be small from 0.00001 to 10000 3. Yes absolute accuracy is a must have But I see that BrowserUK already had a similar problem when computing fisher's exact, so that mihgt be already solved problem.