From fc696fb41a84f5133e7021e635d339fc1b908743 Mon Sep 17 00:00:00 2001 From: Fazle Arefin Date: Sat, 27 Jul 2024 04:53:43 +1000 Subject: [PATCH] bc: edit page (#13308) Co-authored-by: spageektti --- pages/common/bc.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pages/common/bc.md b/pages/common/bc.md index a2b8212c8d..221eb98afd 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`