diff --git a/312/notes/math.bc b/312/notes/math.bc new file mode 100644 index 0000000..c192761 --- /dev/null +++ b/312/notes/math.bc @@ -0,0 +1,18 @@ +# 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; +} +