Worked example

Data: 48 18

→ GCD = 6; LCM = 144

Method and scope

Enter 2–100 integers, at most 100 digits each. Negative inputs use their absolute value. gcd(0,0)=0 by convention; any zero makes the LCM zero. Euclid’s algorithm gives exact integer results.

gcd(a,b)=gcd(b,a mod b); lcm(a,b)=|a/gcd(a,b) × b|

Precision and limits

≈ marks an approximation. Display rounding does not change the internal calculation.

Sources