Returns the greatest common divisor of two numbers. That is, the smallest number that is a whole-number factor of both numbers.
:ClrDraw :Input "NUMERATOR",N :Input "DENOMINATOR",D :Output(1,1,N,"/",D) :N/gcd(N,D)→N :D/gcd(N,D)→D :Output(2,1,"SIMPLIFIED:") :Output(3,1,N,"/",D)
This gets a fraction. It prints the fraction. Then it simplifies the fraction by dividing both numbers by the gcd. Then it prints the fraction again.