L
Lie
Well, I do a test on my own fraction class. I found out that if we set a
limit to the numerators and denominators, the resulting output fraction
would have limit too. I can't grow my fraction any more than this limit
no matter how many iteration I do on them. I do the test is by something
like this (I don't have the source code with me right now, it's quite
long if it includes the fraction class, but I think you could use any
fraction class that automatically simplify itself, might post the real
code some time later):while True:
a = randomly do (a + b) or (a - b)
b = random fraction between [0-100]/[0-100] print aAnd this limit is much lower than n!. I think it's sum(primes(n)), but
I've got no proof for this one yet.
*jaw drops*
Please stop trying to "help" convince people that rational classes are
safe to use. That's the sort of "help" that we don't need.
For the record, it is a perfectly good strategy to *artificially* limit
the denominator of fractions to some maximum value. (That's more or less
the equivalent of setting your floating point values to a maximum number
of decimal places.) But without that artificial limit, repeated addition
of fractions risks having the denominator increase without limit.
No, it is a real limit. This is what I'm talking about. If the input
data has a limit, the output data has a real limit, not a defined-
limit. If the input data's denominator is unbounded, the output
fraction's denominator is also unbounded
In a repeated addition and subtraction with input data that have limits