A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: how to make Simplify fractions in actionscript 3

  1. #1
    Senior Member
    Join Date
    May 2016
    Posts
    451

    how to make Simplify fractions in actionscript 3

    hello
    At first I apologize for my bad English language
    Because of this I will explain the required by image

    Attached Files Attached Files

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    There's more than one way to skin this cat...

    You could find all the prime factors of both the numerator and denominator and eliminate any factors they have in common. In your example. the prime factors of 33 are 3, 11 and the prime factors of 9 are 3, 3. Since the numerator and denominator both contain a 3, you eliminate that number (i.e. divide numerator and denominator by 3) leaving 11 / 3. Here's an algorithm to find the prime factors: https://www.geeksforgeeks.org/print-...a-given-number

    Another way would be to find the GCD (greatest common divisor) of the numerator and denominator and then divide them both by the GCD. You can use Euclid's algorithm for this: https://en.wikipedia.org/wiki/Euclidean_algorithm
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  3. #3
    Senior Member
    Join Date
    May 2016
    Posts
    451
    Quote Originally Posted by kofa View Post
    hello
    At first I apologize for my bad English language
    Because of this I will explain the required by image


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