Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Greatest Common Denomonator

Author
Message
gamergod88
7
Years of Service
User Offline
Joined: 28th Apr 2016
Location:
Posted: 31st May 2016 16:51 Edited at: 31st May 2016 16:52
Is there a function for finding the GCD? If not can I have some help; I have tried and failed already. I am trying to simplify a fraction.
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 31st May 2016 21:49 Edited at: 1st Jun 2016 08:34
This is math, and math is evil - or at least that is what I got out of school thinking whilst barely skating through by the skin of my teeth in high school algebra. mind you, this is decades ago...

Anyhow, there is no such function in AGC, but I whipped one up. All credits to Wikipedia who had a code example written in what appears to be a Pascal or Modula2 inspired pseudo-code.



I tested it with a few numbers, and it seems allright.
gamergod88
7
Years of Service
User Offline
Joined: 28th Apr 2016
Location:
Posted: 1st Jun 2016 13:42
Thanks!

Login to post a reply

Server time is: 2024-04-26 10:40:36
Your offset time is: 2024-04-26 10:40:36