11-04-2024, 10:16 PM
Hi Petr,
There are much simpler ways to do GCD:
https://rosettacode.org/wiki/Greatest_co...isor#BASIC
my favorite:
There are much simpler ways to do GCD:
https://rosettacode.org/wiki/Greatest_co...isor#BASIC
my favorite:
Code: (Select All)
_Title "GCD = Greatest Common Denominator" ' b+ 2020-05-21 from SB
While 1
Input "enter a, b or 0 to quit "; a, b
If a <> 0 And b <> 0 Then Print GCD(a, b) Else End
Wend
Function GCD (a As _Integer64, b As _Integer64)
While a <> 0 And b <> 0
If a > b Then a = a Mod b Else b = b Mod a
Wend
GCD = a + b
End Function
b = b + ...