Greatest common divisor: Difference between revisions
Changed to show GCD of 0 and 0 as 0.
m (Fix last image position) |
(Changed to show GCD of 0 and 0 as 0.) |
||
Line 3,464:
a = fn ControlIntegerValue( _fldA )
b = fn ControlIntegerValue( _fldB )
if a + b == 0 then textlabel _ansA, @"= 0" : textlabel _ansB, @"= 0" : exit fn
c = fn GCD( a, b )
textlabel _ansA, fn stringwithformat(@"= %ld x %ld", c, a / c )
|