Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,21 @@
gcd() {
# Calculate $1 % $2 until $2 becomes zero.
until test 0 -eq "$2"; do
# Parallel assignment: set -- 1 2
set -- "$2" "`expr "$1" % "$2"`"
done
# Echo absolute value of $1.
test 0 -gt "$1" && set -- "`expr 0 - "$1"`"
echo "$1"
}
lcm() {
set -- "$1" "$2" "`gcd "$1" "$2"`"
set -- "`expr "$1" \* "$2" / "$3"`"
test 0 -gt "$1" && set -- "`expr 0 - "$1"`"
echo "$1"
}
lcm 30 -42
# => 210