aboutsummaryrefslogtreecommitdiff
path: root/bc.library
diff options
context:
space:
mode:
Diffstat (limited to 'bc.library')
-rw-r--r--bc.library10
1 files changed, 9 insertions, 1 deletions
diff --git a/bc.library b/bc.library
index 6b94a01..76a2722 100644
--- a/bc.library
+++ b/bc.library
@@ -5,7 +5,7 @@
5 * The following functions are available (aliases in parentheses): 5 * The following functions are available (aliases in parentheses):
6 * General utility: max, min, sgn, abs, floor, ceiling 6 * General utility: max, min, sgn, abs, floor, ceiling
7 * Arithmetic: factorial(fact), binomial(binom, bin), gcd, lcm, totient(phi) 7 * Arithmetic: factorial(fact), binomial(binom, bin), gcd, lcm, totient(phi)
8 * Calculus: exp, log(ln), pow, sin, cos, tan, cosh, sinh, tanh 8 * Calculus: exp, log(ln), pow, root, sin, cos, tan, cosh, sinh, tanh
9 * atan, atan2, asin, acos, atanh, asinh, acosh 9 * atan, atan2, asin, acos, atanh, asinh, acosh
10 * Constants (as functions): e(), pi() 10 * Constants (as functions): e(), pi()
11 * 11 *
@@ -187,6 +187,14 @@ define pow(a, b) {
187 return a ^ b 187 return a ^ b
188} 188}
189 189
190define root(a, b) {
191 auto res
192 scale += 5
193 res = pow(b, 1/a)
194 scale -= 5
195 return res / 1
196}
197
190define trig(x, ii, in, id) { 198define trig(x, ii, in, id) {
191 auto i, n, d, series 199 auto i, n, d, series
192 scale += 10 200 scale += 10

Generated with cgit - Back to sebastiano.tronto.net