A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Fractions

  1. #1
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    923

    Fractions

    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?
    Attached Files Attached Files
    who is this? a word of friendly advice: FFS stop using AS2

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    perhaps provide a online swf file next time?- might turn into more or any replies

  3. #3
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    923
    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..
    who is this? a word of friendly advice: FFS stop using AS2

  4. #4
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    ...Why fractions? Are there any practical applications where having fractions would outweigh the performance loss?
    The greatest pleasure in life is doing what people say you cannot do.
    - Walter Bagehot
    The height of cleverness is to be able to conceal it.
    - Francois de La Rochefoucauld

  5. #5
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    923
    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.
    who is this? a word of friendly advice: FFS stop using AS2

  6. #6
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    923
    Quote Originally Posted by realMakc
    p.s.: I am going to add neat trick with primes that would make this class getting faster and faster at runtime..
    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.
    who is this? a word of friendly advice: FFS stop using AS2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center