csnotes/312/notes/math.bc
2019-09-26 11:18:58 -07:00

19 lines
274 B
Plaintext

# What is this?
# Compilation of scripts to written for bc since bc is:
# a. literally a calculator
# b. code is pretty dang readable and useful
# Simple GCD
define gcd(a,b) {
while(a != b) {
if(a>b) {
a = a - b;
}
if(b>a) {
b = b - a;
}
}
return a;
}