diff --git a/.config/shell/bin/calc b/.config/shell/bin/calc index 6306c4a..7882ba5 100755 --- a/.config/shell/bin/calc +++ b/.config/shell/bin/calc @@ -1,6 +1,8 @@ #!/bin/zsh -# Note: this is compatible with `sh`, but because -# `sh` does not handle floats, I'm choosing `zsh`. +# Basic calculator using the shell +# Note that zsh can handle floating-point math, whereas POSIX sh cannot -# Believe it or not, zsh makes for a fine calculator -echo $(($*)) +for v; do + printf ' %s ' "$(($v))" +done +echo