diff --git a/pages/common/bc.md b/pages/common/bc.md index a2b8212c8..221eb98af 100644 --- a/pages/common/bc.md +++ b/pages/common/bc.md @@ -1,16 +1,16 @@ # bc > An arbitrary precision calculator language. -> See also: `dc`. +> See also: `dc`, `qalc`. > More information: . - Start an interactive session: `bc` -- Start an interactive session with the standard math library enabled: +- Start an [i]nteractive session with the standard math [l]ibrary enabled: -`bc --mathlib` +`bc --interactive --mathlib` - Calculate an expression: @@ -27,3 +27,7 @@ - Calculate a sine/cosine/arctangent/natural logarithm/exponential function using `mathlib`: `echo '{{s|c|a|l|e}}({{1}})' | bc --mathlib` + +- Execute an inline factorial script: + +`echo "define factorial(n) { if (n <= 1) return 1; return n*factorial(n-1); }; factorial({{10}})" | bc`