Just so it goes somewhere until I actually do something with it, here goes AS3 Fraction class inspired by this thing.
Tell me what you think?
Printable View
Just so it goes somewhere until I actually do something with it, here goes AS3 Fraction class inspired by this thing.
Tell me what you think?
perhaps provide a online swf file next time?- might turn into more or any replies
well, if people can't be arsed to open flash and compile a file, can they be arsed to think of things that can be improved?
p.s.: I am going to add neat trick with primes that would make this class getting faster and faster at runtime..
...Why fractions? Are there any practical applications where having fractions would outweigh the performance loss?
maybe some sort of pathological "divergent" calculations where rounding errors accumulate... I'm not sure if there actually are such applications, this is "for fun only" doodle.
the idea was this: if we keep static list of sequential primes, and divide by every number in the list (rather than every number i existance), and then by all numbers greater than the list's max, until some k divides our numerator/denominator without reminder, then this k must be a prime (since otherwise something less than k would do it)... so I thought I could add this k to primes list every time, and so this list would grow, leading to faster computations after some time; however, we cant add k to the list, because we don't know if there were primes less than k but greater than list's max :( so, no magic trick for you, sorry.Quote:
Originally Posted by realMakc