WARFRAME Wiki
Advertisement
WARFRAME Wiki
Test suite statusFailed
Scribunto test cases229/230
Code coverage47/47
Unit test report for Math.
  • Execution time: 194.1 ms
  • Test cases failing:
  • Test members missing: none

Scribunto test cases

p.abs

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|abs}}
Error: Not enough input arguments | p.abs(num). Error: Not enough input arguments | p.abs(num).
Passing
{{#invoke:math|abs}}
Error: Not enough input arguments | p.abs(num). Error: Not enough input arguments | p.abs(num).
Passing
{{#invoke:math|abs|-123.456}}
123.456 123.456
Passing
{{#invoke:math|abs|123.456}}
123.456 123.456

p.acos

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|acos}}
Error: Not enough input arguments | p.acos(num). Error: Not enough input arguments | p.acos(num).
Passing
{{#invoke:math|acos}}
Error: Not enough input arguments | p.acos(num). Error: Not enough input arguments | p.acos(num).
Passing
{{#invoke:math|acos|1}}
0 0

p.add

13/13
StatusCodeExpectedActualDiffers at
Passing
p.add()
Error: Not enough input arguments | p.add(n, m). Error: Not enough input arguments | p.add(n, m).
Passing
p.add(123)
Error: Not enough input arguments | p.add(n, m). Error: Not enough input arguments | p.add(n, m).
Passing
p.add([2] = 0.456)
Error: Not enough input arguments | p.add(n, m). Error: Not enough input arguments | p.add(n, m).
Passing
p.add(123, 0.456)
123.456 123.456
Passing
p.add(123, true)
124 124
Passing
p.add([2] = 123)
true true
Passing
p.add(true, true)
false false
Passing
p.add(123, "0.456")
123.456 123.456
Passing
p.add("123", 0.456)
123.456 123.456
Passing
p.add("123", "0.456")
123.456 123.456
Passing
p.add(123, { 0.4, 0.05, 0.006 })
123.456 123.456
Passing
p.add({ 123, 124, 125 }, 0.456)
{ 123.456, 124.456, 125.456 }{ 123.456, 124.456, 125.456 }
Passing
p.add({ 123, 124, 125 }, { 0.456, 0.789, 0.123 })
{ 123.456, 124.789, 125.123 }{ 123.456, 124.789, 125.123 }

p.asin

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|asin}}
Error: Not enough input arguments | p.asin(num). Error: Not enough input arguments | p.asin(num).
Passing
{{#invoke:math|asin}}
Error: Not enough input arguments | p.asin(num). Error: Not enough input arguments | p.asin(num).
Passing
{{#invoke:math|asin|1}}
1.5707963267949 1.5707963267949

p.atan

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|atan}}
Error: Not enough input arguments | p.atan(num) or p.atan(num, den). Error: Not enough input arguments | p.atan(num) or p.atan(num, den).
Passing
{{#invoke:math|atan}}
Error: Not enough input arguments | p.atan(num) or p.atan(num, den). Error: Not enough input arguments | p.atan(num) or p.atan(num, den).
Passing
{{#invoke:math|atan|1}}
0.78539816339745 0.78539816339745

p.binomial

9/9
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|binomial}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial|1/6}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial||2}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial|||2}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial|1/6|2}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial|1/6||2}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial||2|2}}
Error: Not enough input arguments | p.binomial(p, n, r). Error: Not enough input arguments | p.binomial(p, n, r).
Passing
{{#invoke:math|binomial|1/6|6|1}}
0.40187757201646 0.40187757201646

p.ceil

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|ceil}}
Error: Not enough input arguments | p.ceil(num). Error: Not enough input arguments | p.ceil(num).
Passing
{{#invoke:math|ceil}}
Error: Not enough input arguments | p.ceil(num). Error: Not enough input arguments | p.ceil(num).
Passing
{{#invoke:math|ceil|123.456}}
124 124
Passing
{{#invoke:math|ceil|-123.456}}
-123 -123

p.cos

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|cos}}
Error: Not enough input arguments | p.cos(num). Error: Not enough input arguments | p.cos(num).
Passing
{{#invoke:math|cos}}
Error: Not enough input arguments | p.cos(num). Error: Not enough input arguments | p.cos(num).
Passing
{{#invoke:math|cos|#pi/2}}
0 0

p.cosh

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|cosh}}
Error: Not enough input arguments | p.cosh(num). Error: Not enough input arguments | p.cosh(num).
Passing
{{#invoke:math|cosh}}
Error: Not enough input arguments | p.cosh(num). Error: Not enough input arguments | p.cosh(num).
Passing
{{#invoke:math|cosh|#pi/2}}
2.5091784786581 2.5091784786581

p.deg

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|deg}}
Error: Not enough input arguments | p.deg(num). Error: Not enough input arguments | p.deg(num).
Passing
{{#invoke:math|deg}}
Error: Not enough input arguments | p.deg(num). Error: Not enough input arguments | p.deg(num).
Passing
{{#invoke:math|deg|#pi/4}}
45 45

p.div

13/13
StatusCodeExpectedActualDiffers at
Passing
p.div()
Error: Not enough input arguments | p.div(n, m). Error: Not enough input arguments | p.div(n, m).
Passing
p.div(123)
Error: Not enough input arguments | p.div(n, m). Error: Not enough input arguments | p.div(n, m).
Passing
p.div([2] = 3)
Error: Not enough input arguments | p.div(n, m). Error: Not enough input arguments | p.div(n, m).
Passing
p.div(123, 3)
41 41
Passing
p.div(123, true)
123 123
Passing
p.div([2] = 123)
0 0
Passing
p.div(true, true)
1 1
Passing
p.div(123, "3")
41 41
Passing
p.div("123", 3)
41 41
Passing
p.div("123", "3")
41 41
Passing
p.div(123, { 0.5, 1, 1.5 })
41 41
Passing
p.div({ 123, 126, 129 }, 3)
{ 41, 42, 43 }{ 41, 42, 43 }
Passing
p.div({ 123, 124, 125 }, { 3, 4, 5 })
{ 41, 31, 25 }{ 41, 31, 25 }

p.eval

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|eval}}
Error: Not enough input arguments | p.eval(num). Error: Not enough input arguments | p.eval(num).
Passing
{{#invoke:math|eval}}
Error: Not enough input arguments | p.eval(num). Error: Not enough input arguments | p.eval(num).
Passing
{{#invoke:math|eval|-10 + 50 - 10^2 * 5 / 6}}
-43.333333333333 -43.333333333333
Passing
{{#invoke:math|eval|{{text||15%|hover=Gram's base crit chance}} {{mul}} [1 + {{M|True Steel|120%}} + {{M|Blood Rush|60%}} {{mul}} ({{text||7|hover=Combo Multiplier}} - 1)]}}
0.87 0.87

p.ex

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|ex}}
Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...). Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...).
Passing
{{#invoke:math|ex}}
Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...). Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...).
Passing
{{#invoke:math|ex|1/6}}
5 – 6 5 – 6
Passing
{{#invoke:math|ex|0.3872|0.3872|0.2256}}
6 – 7 6 – 7

p.exp

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|exp}}
2.718281828459 2.718281828459
Passing
{{#invoke:math|exp}}
2.718281828459 2.718281828459
Passing
{{#invoke:math|exp|3}}
20.085536923188 20.085536923188
Passing
{{#invoke:math|exp|-3}}
0.049787068367864 0.049787068367864

p.floor

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|floor}}
Error: Not enough input arguments | p.floor(num). Error: Not enough input arguments | p.floor(num).
Passing
{{#invoke:math|floor}}
Error: Not enough input arguments | p.floor(num). Error: Not enough input arguments | p.floor(num).
Passing
{{#invoke:math|floor|123.456}}
123 123
Passing
{{#invoke:math|floor|-123.456}}
-124 -124

p.formatnum

6/6
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|formatnum}}
Error: Not enough input arguments | p.formatnum(num) or p.formatnum(num, code). Error: Not enough input arguments | p.formatnum(num) or p.formatnum(num, code).
Passing
{{#invoke:math|formatnum}}
Error: Not enough input arguments | p.formatnum(num) or p.formatnum(num, code). Error: Not enough input arguments | p.formatnum(num) or p.formatnum(num, code).
Passing
{{#invoke:math|formatnum|-123456789.87654}}
−123,456,789.87654 −123,456,789.87654
Passing
{{#invoke:math|formatnum|-123456789.87654321|ar}}
−١٢٣٬٤٥٦٬٧٨٩٫٨٧٦٥٤ −١٢٣٬٤٥٦٬٧٨٩٫٨٧٦٥٤
Passing
{{#invoke:math|formatnum|-123456789.87654||true}}
−123456789.87654 −123456789.87654
Passing
{{#invoke:math|formatnum|-123456789.87654321|ar|true}}
−١٢٣٤٥٦٧٨٩.٨٧٦٥٤ −١٢٣٤٥٦٧٨٩.٨٧٦٥٤

p.frac

5/5
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|frac}}
Error: Not enough input arguments | p.frac(num) or p.frac(num, factor, epsilon). Error: Not enough input arguments | p.frac(num) or p.frac(num, factor, epsilon).
Passing
{{#invoke:math|frac}}
Error: Not enough input arguments | p.frac(num) or p.frac(num, factor, epsilon). Error: Not enough input arguments | p.frac(num) or p.frac(num, factor, epsilon).
Passing
{{#invoke:math|frac|1/6}}
\frac{\text{1}}{\text{6}}\! \frac{\text{1}}{\text{6}}\!
Passing
{{#invoke:math|frac|2.1142191999126|#e}}
\frac{\text{7}}{\text{9}}\!e \frac{\text{7}}{\text{9}}\!e
Passing
{{#invoke:math|frac|9.8994949366117||-10}}
\frac{\text{39398990}}{\text{3979899}}\! \frac{\text{39398990}}{\text{3979899}}\!

p.gamma

5/5
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|gamma}}
Error: Not enough input arguments | p.gamma(num). Error: Not enough input arguments | p.gamma(num).
Passing
{{#invoke:math|gamma}}
Error: Not enough input arguments | p.gamma(num). Error: Not enough input arguments | p.gamma(num).
Passing
{{#invoke:math|gamma|2}}
1 1
Passing
{{#invoke:math|gamma|#pi}}
2.2880378 2.2880378
Passing
{{#invoke:math|gamma|1/2}}
1.7724538 1.7724538

p.gcd

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|gcd}}
Error: Not enough input arguments | p.gcd(num1, num2). Error: Not enough input arguments | p.gcd(num1, num2).
Passing
{{#invoke:math|gcd||6}}
Error: Not enough input arguments | p.gcd(num1, num2). Error: Not enough input arguments | p.gcd(num1, num2).
Passing
{{#invoke:math|gcd|15}}
Error: Not enough input arguments | p.gcd(num1, num2). Error: Not enough input arguments | p.gcd(num1, num2).
Passing
{{#invoke:math|gcd|15|6}}
3 3

p.ln

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|ln}}
Error: Not enough input arguments | p.ln(num). Error: Not enough input arguments | p.ln(num).
Passing
{{#invoke:math|ln}}
Error: Not enough input arguments | p.ln(num). Error: Not enough input arguments | p.ln(num).
Passing
{{#invoke:math|ln|7}}
1.9459101490553 1.9459101490553

p.log

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|log}}
Error: Not enough input arguments | p.log(num) or p.log(num, base). Error: Not enough input arguments | p.log(num) or p.log(num, base).
Passing
{{#invoke:math|log}}
Error: Not enough input arguments | p.log(num) or p.log(num, base). Error: Not enough input arguments | p.log(num) or p.log(num, base).
Passing
{{#invoke:math|log|7}}
0.84509804001426 0.84509804001426
Passing
{{#invoke:math|log|7|3}}
1.7712437491614 1.7712437491614

p.max

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|max}}
Error: Not enough input arguments | p.max(num1, num2, num3, ...). Error: Not enough input arguments | p.max(num1, num2, num3, ...).
Passing
{{#invoke:math|max}}
Error: Not enough input arguments | p.max(num1, num2, num3, ...). Error: Not enough input arguments | p.max(num1, num2, num3, ...).
Passing
{{#invoke:math|max|-2|-1|0|1|2}}
2 2

p.min

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|min}}
Error: Not enough input arguments | p.min(num1, num2, num3, ...). Error: Not enough input arguments | p.min(num1, num2, num3, ...).
Passing
{{#invoke:math|min}}
Error: Not enough input arguments | p.min(num1, num2, num3, ...). Error: Not enough input arguments | p.min(num1, num2, num3, ...).
Passing
{{#invoke:math|min|-2|-1|0|1|2}}
-2 -2

p.mod

8/8
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|mod}}
Error: Not enough input arguments | p.mod(num, den). Error: Not enough input arguments | p.mod(num, den).
Passing
{{#invoke:math|mod}}
Error: Not enough input arguments | p.mod(num, den). Error: Not enough input arguments | p.mod(num, den).
Passing
{{#invoke:math|mod|67}}
Error: Not enough input arguments | p.mod(num, den). Error: Not enough input arguments | p.mod(num, den).
Passing
{{#invoke:math|mod|67|5}}
2 2
Passing
{{#invoke:math|mod|-67|5}}
-2 -2
Passing
{{#invoke:math|mod|67|-5}}
2 2
Passing
{{#invoke:math|mod|-67|-5}}
-2 -2
Passing
{{#invoke:math|mod||5}}
Error: Not enough input arguments | p.mod(num, den). Error: Not enough input arguments | p.mod(num, den).

p.modf

8/8
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|modf}}
Error: Not enough input arguments | p.modf(num). Error: Not enough input arguments | p.modf(num).
Passing
{{#invoke:math|modf}}
Error: Not enough input arguments | p.modf(num). Error: Not enough input arguments | p.modf(num).
Passing
{{#invoke:math|modf|-7}}
-0 -0
Passing
{{#invoke:math|modf|2.33333333}}
0.33333333 0.33333333
Passing
{{#invoke:math|modf|-7|int=y}}
-7 -7
Passing
{{#invoke:math|modf|2.33333333|int=true}}
2 2
Passing
{{#invoke:math|modf|-7|int=y|dec=t}}
-7-0 -7-0
Passing
{{#invoke:math|modf|2.33333333|int=true|dec=1}}
20.33333333 20.33333333

p.mul

13/13
StatusCodeExpectedActualDiffers at
Passing
p.mul()
Error: Not enough input arguments | p.mul(n, m). Error: Not enough input arguments | p.mul(n, m).
Passing
p.mul(123)
Error: Not enough input arguments | p.mul(n, m). Error: Not enough input arguments | p.mul(n, m).
Passing
p.mul([2] = 3)
Error: Not enough input arguments | p.mul(n, m). Error: Not enough input arguments | p.mul(n, m).
Passing
p.mul(41, 3)
123 123
Passing
p.mul(41, true)
41 41
Passing
p.mul([2] = 41)
false false
Passing
p.mul(true, true)
true true
Passing
p.mul(41, "3")
123 123
Passing
p.mul("41", 3)
123 123
Passing
p.mul("41", "3")
123 123
Passing
p.mul(41, { 0.5, 1, 1.5 })
123 123
Passing
p.mul({ 41, 42, 43 }, 3)
{ 123, 126, 129 }{ 123, 126, 129 }
Passing
p.mul({ 41, 31, 25 }, { 3, 4, 5 })
{ 123, 124, 125 }{ 123, 124, 125 }

p.ncr

5/5
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|ncr}}
Error: Not enough input arguments | p.ncr(n, r). Error: Not enough input arguments | p.ncr(n, r).
Passing
{{#invoke:math|ncr}}
Error: Not enough input arguments | p.ncr(n, r). Error: Not enough input arguments | p.ncr(n, r).
Passing
{{#invoke:math|ncr|7}}
Error: Not enough input arguments | p.ncr(n, r). Error: Not enough input arguments | p.ncr(n, r).
Passing
{{#invoke:math|ncr|7|3}}
35 35
Passing
{{#invoke:math|ncr||3}}
Error: Not enough input arguments | p.ncr(n, r). Error: Not enough input arguments | p.ncr(n, r).

p.ng

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|ng}}
Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...). Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...).
Passing
{{#invoke:math|ng}}
Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...). Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...).
Passing
{{#invoke:math|ng|1/6}}
38 ± 13 38 ± 13
Passing
{{#invoke:math|ng|0.3872|0.3872|0.2256}}
27 ± 9 27 ± 9

p.npr

5/5
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|npr}}
Error: Not enough input arguments | p.npr(n, r). Error: Not enough input arguments | p.npr(n, r).
Passing
{{#invoke:math|npr}}
Error: Not enough input arguments | p.npr(n, r). Error: Not enough input arguments | p.npr(n, r).
Passing
{{#invoke:math|npr|7}}
Error: Not enough input arguments | p.npr(n, r). Error: Not enough input arguments | p.npr(n, r).
Passing
{{#invoke:math|npr|7|3}}
210 210
Passing
{{#invoke:math|npr||3}}
Error: Not enough input arguments | p.npr(n, r). Error: Not enough input arguments | p.npr(n, r).

p.percentage

10/10
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|percentage}}
Error: Not enough input arguments | p.percentage(num). Error: Not enough input arguments | p.percentage(num).
Passing
{{#invoke:math|percentage}}
Error: Not enough input arguments | p.percentage(num). Error: Not enough input arguments | p.percentage(num).
Passing
{{#invoke:math|percentage|0}}
0% 0%
Passing
{{#invoke:math|percentage|1}}
100% 100%
Passing
{{#invoke:math|percentage|1.00000000000001}}
100% 100%
Passing
{{#invoke:math|percentage|1.5}}
150% 150%
Passing
{{#invoke:math|percentage|0.5}}
50% 50%
Passing
{{#invoke:math|percentage|0.5000}}
50% 50%
Passing
{{#invoke:math|percentage|0.9999}}
99.99% 99.99%
Passing
{{#invoke:math|percentage|0.999999}}
100% 100%

p.pow

8/8
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|pow}}
Error: Not enough input arguments | p.pow(base, exponent). Error: Not enough input arguments | p.pow(base, exponent).
Passing
{{#invoke:math|pow}}
Error: Not enough input arguments | p.pow(base, exponent). Error: Not enough input arguments | p.pow(base, exponent).
Passing
{{#invoke:math|pow|7}}
Error: Not enough input arguments | p.pow(base, exponent). Error: Not enough input arguments | p.pow(base, exponent).
Passing
{{#invoke:math|pow|7|3}}
343 343
Passing
{{#invoke:math|pow|-7|3}}
-343 -343
Passing
{{#invoke:math|pow|7|-3}}
0.0029154518950437 0.0029154518950437
Passing
{{#invoke:math|pow|-7|-3}}
-0.0029154518950437 -0.0029154518950437
Passing
{{#invoke:math|pow||3}}
Error: Not enough input arguments | p.pow(base, exponent). Error: Not enough input arguments | p.pow(base, exponent).

p.rad

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|rad}}
Error: Not enough input arguments | p.rad(num). Error: Not enough input arguments | p.rad(num).
Passing
{{#invoke:math|rad}}
Error: Not enough input arguments | p.rad(num). Error: Not enough input arguments | p.rad(num).
Passing
{{#invoke:math|rad|45}}
0.78539816339745 0.78539816339745

p.rand

5/5
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|rand|||seed=0}}
0.90337034822599_0 0.90337034822599_0
Passing
{{#invoke:math|rand|100||seed=0}}
91_0 91_0
Passing
{{#invoke:math|rand|-20|50|seed=0}}
44_0 44_0
Passing
{{#invoke:math|rand|50|-20|seed=0}}
44_0 44_0
Passing
{{#invoke:math|rand||100|seed=0}}
0.90337034822599_0 0.90337034822599_0

p.replace

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|replace}}
() ()
Passing
{{#invoke:math|replace|		abs(15 + sqrt(1 - 15^2)	-	[(360° mod 2•#pi)	]	)		}}
(abs(15+(1-15^2)-(360*3.1415926535898/180)mod(2*3.1415926535898))) (abs(15+(1-15^2)-(360*3.1415926535898/180)mod(2*3.1415926535898)))

p.replaceWithSymbol

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|replaceWithSymbol}}
Passing
{{#invoke:math|replaceWithSymbol|abs(#phi + sqrt(1 - #e^2)	-	[(#gamma mod 2•#pi)	]	)}}
abs(φ + sqrt(1 - e^2) - [(γ mod 2•π) ] ) abs(φ + sqrt(1 - e^2) - [(γ mod 2•π) ] )

p.round

11/12
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|round}}
Error: Not enough input arguments | p.round(num) or p.round(num, multiple). Error: Not enough input arguments | p.round(num) or p.round(num, multiple).
Passing
{{#invoke:math|round}}
Error: Not enough input arguments | p.round(num) or p.round(num, multiple). Error: Not enough input arguments | p.round(num) or p.round(num, multiple).
Passing
{{#invoke:math|round|123.456}}
123.456 123.456
Passing
{{#invoke:math|round|123.456|0.5}}
123.5 123.5
Passing
{{#invoke:math|round|-123.456|0.5}}
−123.5 −123.5
Failing
{{#invoke:math|round|-12345678910111213.141516|0.5}}
−1.2345678910111E+16 −1.2345678910111×1016 2
" " vs. "1"
Passing
{{#invoke:math|round|1|0.1}}
1 1
Passing
{{#invoke:math|round|0.5|2}}
0 0
Passing
{{#invoke:math|round|2.99|2}}
2 2
Passing
{{#invoke:math|round|3|2}}
4 4
Passing
{{#invoke:math|round|0.6|0.01}}
0.6 0.6
Passing
{{#invoke:math|round|80|1}}
80 80

p.sin

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|sin}}
Error: Not enough input arguments | p.sin(num). Error: Not enough input arguments | p.sin(num).
Passing
{{#invoke:math|sin}}
Error: Not enough input arguments | p.sin(num). Error: Not enough input arguments | p.sin(num).
Passing
{{#invoke:math|sin|#pi/2}}
1 1

p.sinh

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|sinh}}
Error: Not enough input arguments | p.sinh(num). Error: Not enough input arguments | p.sinh(num).
Passing
{{#invoke:math|sinh}}
Error: Not enough input arguments | p.sinh(num). Error: Not enough input arguments | p.sinh(num).
Passing
{{#invoke:math|sinh|#pi/2}}
2.3012989023073 2.3012989023073

p.sqrt

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|sqrt}}
Error: Not enough input arguments | p.sqrt(num). Error: Not enough input arguments | p.sqrt(num).
Passing
{{#invoke:math|sqrt}}
Error: Not enough input arguments | p.sqrt(num). Error: Not enough input arguments | p.sqrt(num).
Passing
{{#invoke:math|sqrt|7}}
2.6457513110646 2.6457513110646
Passing
{{#invoke:math|sqrt|-7}}
2.6457513110646 2.6457513110646

p.sub

13/13
StatusCodeExpectedActualDiffers at
Passing
p.sub()
Error: Not enough input arguments | p.sub(n, m). Error: Not enough input arguments | p.sub(n, m).
Passing
p.sub(321)
Error: Not enough input arguments | p.sub(n, m). Error: Not enough input arguments | p.sub(n, m).
Passing
p.sub([2] = 123)
Error: Not enough input arguments | p.sub(n, m). Error: Not enough input arguments | p.sub(n, m).
Passing
p.sub(321, 123)
198 198
Passing
p.sub(321, true)
320 320
Passing
p.sub([2] = 123)
false false
Passing
p.sub(true, true)
true true
Passing
p.sub(321, "123")
198 198
Passing
p.sub("321", 123)
198 198
Passing
p.sub("321", "123")
198 198
Passing
p.sub(321, { 100, 20, 3 })
198 198
Passing
p.sub({ 321, 322, 323 }, 123)
{ 198, 199, 200 }{ 198, 199, 200 }
Passing
p.sub({ 321, 654, 987 }, { 123, 456, 789 })
{ 198, 198, 198 }{ 198, 198, 198 }

p.sum

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|sum}}
Error: Not enough input arguments | p.sum(num1, num2, num3, ...). Error: Not enough input arguments | p.sum(num1, num2, num3, ...).
Passing
{{#invoke:math|sum||2|3|5||11}}
21 21
Passing
{{#invoke:math|sum|0.3872|0.3872|0.2256}}
1 1

p.tan

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|tan}}
Error: Not enough input arguments | p.tan(num). Error: Not enough input arguments | p.tan(num).
Passing
{{#invoke:math|tan}}
Error: Not enough input arguments | p.tan(num). Error: Not enough input arguments | p.tan(num).
Passing
{{#invoke:math|tan|#pi/4}}
1 1

p.tanh

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|tanh}}
Error: Not enough input arguments | p.tanh(num). Error: Not enough input arguments | p.tanh(num).
Passing
{{#invoke:math|tanh}}
Error: Not enough input arguments | p.tanh(num). Error: Not enough input arguments | p.tanh(num).
Passing
{{#invoke:math|tanh|#pi/4}}
0.65579420263267 0.65579420263267

p.trunc

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:math|trunc}}
Error: Not enough input arguments | p.trunc(num). Error: Not enough input arguments | p.trunc(num).
Passing
{{#invoke:math|trunc}}
Error: Not enough input arguments | p.trunc(num). Error: Not enough input arguments | p.trunc(num).
Passing
{{#invoke:math|trunc|-123.456}}
-123 -123

local userError = require('Dev:User error');
local i18n =  require('Module:I18n').loadMessages('Module:Math/i18n'):useUserLang();
local notEnoughOperands = userError(i18n:msg( { key = 'no-argument', args = { '$1' } } ));
local nw = false;

return {
	eval = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.eval(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.eval(num)')) },
			{ '-10 + 50 - 10^2 * 5 / 6', '-43.333333333333' },
			{ '{{text||15%|hover=Gram\'s base crit chance}} {{mul}} [1 + {{M|True Steel|120%}} + {{M|Blood Rush|60%}} {{mul}} ({{text||7|hover=Combo Multiplier}} - 1)]', '0.87' },
		},
	},
	formatnum = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.formatnum(num) or p.formatnum(num, code)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.formatnum(num) or p.formatnum(num, code)')) },
			{ '-123456789.87654', '−123,456,789.87654' },
			{ '-123456789.87654321|ar', '−١٢٣٬٤٥٦٬٧٨٩٫٨٧٦٥٤' },
			{ '-123456789.87654||true', '−123456789.87654' },
			{ '-123456789.87654321|ar|true', '−١٢٣٤٥٦٧٨٩.٨٧٦٥٤' },
		},
	},
	abs = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.abs(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.abs(num)')) },
			{ '-123.456', '123.456' },
			{ '123.456', '123.456' },
		},
	},
	acos = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.acos(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.acos(num)')) },
			{ '1', '0' },
		},
	},
	add = {
		options = {
			mode = 'method',
			nowiki = nw,
			unpk = true,
			deep = true,
		},
		tests = {
			{ {}, (notEnoughOperands:gsub('$1', 'p.add(n, m)')) },
			{ {123}, (notEnoughOperands:gsub('$1', 'p.add(n, m)')) },
			{ {nil, 0.456}, (notEnoughOperands:gsub('$1', 'p.add(n, m)')) },
			{ {123, 0.456}, 123.456 },
			{ {123, true}, 124 },
			{ {false, 123}, true },
			{ {true, true}, false },
			{ {123, '0.456'}, 123.456 },
			{ {'123', 0.456}, '123.456' },
			{ {'123', '0.456'}, '123.456' },
			{ {123, {0.4, 0.05, 0.006}}, 123.456 },
			{ {{123, 124, 125}, 0.456}, {123.456, 124.456, 125.456} },
			{ {{123, 124, 125}, {0.456, 0.789, 0.123}}, {123.456, 124.789, 125.123} },
		},
	},
	asin = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.asin(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.asin(num)')) },
			{ '1', '1.5707963267949' },
		},
	},
	atan = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.atan(num) or p.atan(num, den)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.atan(num) or p.atan(num, den)')) },
			{ '1', '0.78539816339745' },
		},
	},
	binomial = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '1/6', (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '|2', (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '||2', (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '1/6|2', (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '1/6||2', (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '|2|2', (notEnoughOperands:gsub('$1', 'p.binomial(p, n, r)')) },
			{ '1/6|6|1', '0.40187757201646' },
		},
	},
	ceil = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.ceil(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.ceil(num)')) },
			{ '123.456', '124' },
			{ '-123.456', '-123' },
		},
	},
	cos = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.cos(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.cos(num)')) },
			{ '#pi/2', '0' },
		},
	},
	cosh = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.cosh(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.cosh(num)')) },
			{ '#pi/2', '2.5091784786581' },
		},
	},
	deg = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.deg(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.deg(num)')) },
			{ '#pi/4', '45' },
		},
	},
	div = {
		options = {
			mode = 'method',
			nowiki = nw,
			unpk = true,
			deep = true,
		},
		tests = {
			{ {}, (notEnoughOperands:gsub('$1', 'p.div(n, m)')) },
			{ {123}, (notEnoughOperands:gsub('$1', 'p.div(n, m)')) },
			{ {nil, 3}, (notEnoughOperands:gsub('$1', 'p.div(n, m)')) },
			{ {123, 3}, 41 },
			{ {123, true}, 123 },
			{ {false, 123}, 0 },
			{ {true, true}, 1 },
			{ {123, '3'}, 41 },
			{ {'123', 3}, '41' },
			{ {'123', '3'}, '41' },
			{ {123, {0.5, 1, 1.5}}, 41 },
			{ {{123, 126, 129}, 3}, {41, 42, 43} },
			{ {{123, 124, 125}, {3, 4, 5}}, {41, 31, 25} },
		},
	},
	ex = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.ex(prob1, prob2, prob3, ...)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.ex(prob1, prob2, prob3, ...)')) },
			{ '1/6', '5 – 6' },
			{ '0.3872|0.3872|0.2256', '6 – 7' },
		},
	},
	exp = {
		options = {
			mode = 'invocation',
			nowiki = nw,
			preprocess = true,
		},
		tests = {
			{ nil, '{{#expr:e}}' },
			{ '', '{{#expr:e}}' },
			{ '3', '{{#expr:e*e*e}}' },
			{ '-3', '{{#expr:1/(e*e*e)}}' },
		},
	},
	floor = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.floor(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.floor(num)')) },
			{ '123.456', '123' },
			{ '-123.456', '-124' },
		},
	},
	frac = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.frac(num) or p.frac(num, factor, epsilon)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.frac(num) or p.frac(num, factor, epsilon)')) },
			{ '1/6', '\\frac{\\text{1}}{\\text{6}}\\!' },
			{ '2.1142191999126|#e', '\\frac{\\text{7}}{\\text{9}}\\!e' },
			{ '9.8994949366117||-10', '\\frac{\\text{39398990}}{\\text{3979899}}\\!' },
		},
	},
	gamma = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.gamma(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.gamma(num)')) },
			{ '2', '1' },
			{ '#pi', '2.2880378' },
			{ '1/2', '1.7724538' },
		},
	},
	gcd = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.gcd(num1, num2)')) },
			{ '|6', (notEnoughOperands:gsub('$1', 'p.gcd(num1, num2)')) },
			{ '15', (notEnoughOperands:gsub('$1', 'p.gcd(num1, num2)')) },
			{ '15|6', '3' },
		},
	},
	ln = {
		options = {
			mode = 'invocation',
			nowiki = nw,
			preprocess = true,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.ln(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.ln(num)')) },
			{ '7', '{{#expr:ln(7)}}' },
		},
	},
	log = {
		options = {
			mode = 'invocation',
			nowiki = nw,
			preprocess = true,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.log(num) or p.log(num, base)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.log(num) or p.log(num, base)')) },
			{ '7', '{{#expr:ln(7)/ln(10)}}' },
			{ '7|3', '{{#expr:ln(7)/ln(3)}}' },
		},
	},
	max = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.max(num1, num2, num3, ...)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.max(num1, num2, num3, ...)')) },
			{ '-2|-1|0|1|2', '2' },
		},
	},
	min = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.min(num1, num2, num3, ...)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.min(num1, num2, num3, ...)')) },
			{ '-2|-1|0|1|2', '-2' },
		},
	},
	mod = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.mod(num, den)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.mod(num, den)')) },
			{ '67', (notEnoughOperands:gsub('$1', 'p.mod(num, den)')) },
			{ '67|5', '2' },
			{ '-67|5', '-2' },
			{ '67|-5', '2' },
			{ '-67|-5', '-2' },
			{ '|5', (notEnoughOperands:gsub('$1', 'p.mod(num, den)')) },
		},
	},
	modf = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.modf(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.modf(num)')) },
			{ '-7', '-0' },
			{ '2.33333333', '0.33333333' },
			{ '-7|int=y', '-7' },
			{ '2.33333333|int=true', '2' },
			{ '-7|int=y|dec=t', '-7-0' },
			{ '2.33333333|int=true|dec=1', '20.33333333' },
		},
	},
	mul = {
		options = {
			mode = 'method',
			nowiki = nw,
			unpk = true,
			deep = true,
		},
		tests = {
			{ {}, (notEnoughOperands:gsub('$1', 'p.mul(n, m)')) },
			{ {123}, (notEnoughOperands:gsub('$1', 'p.mul(n, m)')) },
			{ {nil, 3}, (notEnoughOperands:gsub('$1', 'p.mul(n, m)')) },
			{ {41, 3}, 123 },
			{ {41, true}, 41 },
			{ {false, 41}, false },
			{ {true, true}, true },
			{ {41, '3'}, 123 },
			{ {'41', 3}, '123' },
			{ {'41', '3'}, '123' },
			{ {41, {0.5, 1, 1.5}}, 123 },
			{ {{41, 42, 43}, 3}, {123, 126, 129} },
			{ {{41, 31, 25}, {3, 4, 5}}, {123, 124, 125} },
		},
	},
	ncr = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.ncr(n, r)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.ncr(n, r)')) },
			{ '7', (notEnoughOperands:gsub('$1', 'p.ncr(n, r)')) },
			{ '7|3', '35' },
			{ '|3', (notEnoughOperands:gsub('$1', 'p.ncr(n, r)')) },
		},
	},
	ng = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.ng(prob1, prob2, prob3, ...)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.ng(prob1, prob2, prob3, ...)')) },
			{ '1/6', '38 ± 13' },
			{ '0.3872|0.3872|0.2256', '27 ± 9' },
		},
	},
	npr = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.npr(n, r)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.npr(n, r)')) },
			{ '7', (notEnoughOperands:gsub('$1', 'p.npr(n, r)')) },
			{ '7|3', '210' },
			{ '|3', (notEnoughOperands:gsub('$1', 'p.npr(n, r)')) },
		},
	},
	percentage = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.percentage(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.percentage(num)')) },
			{ '0', '0%' },
			{ '1', '100%' },
			{ '1.00000000000001', '100%' },
			{ '1.5', '150%' },
			{ '0.5', '50%' },
			{ '0.5000', '50%' },
			{ '0.9999', '99.99%' },
			{ '0.999999', '100%' },
		},
	},
	pow = {
		options = {
			mode = 'invocation',
			nowiki = nw,
			preprocess = true,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.pow(base, exponent)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.pow(base, exponent)')) },
			{ '7', (notEnoughOperands:gsub('$1', 'p.pow(base, exponent)')) },
			{ '7|3', '{{#expr:7*7*7}}' },
			{ '-7|3', '{{#expr:-7*7*7}}' },
			{ '7|-3', '{{#expr:1/(7*7*7)}}' },
			{ '-7|-3', '{{#expr:-1/(7*7*7)}}' },
			{ '|3', (notEnoughOperands:gsub('$1', 'p.pow(base, exponent)')) },
		},
	},
	rad = {
		options = {
			mode = 'invocation',
			nowiki = nw,
			preprocess = true,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.rad(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.rad(num)')) },
			{ '45', '{{#expr:45*pi/180}}' },
		},
	},
	rand = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ '||seed=0', '0.90337034822599_0' },
			{ '100||seed=0', '91_0' },
			{ '-20|50|seed=0', '44_0' },
			{ '50|-20|seed=0', '44_0' },
			{ '|100|seed=0', '0.90337034822599_0' },
		},
	},
	replace = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, '()' },
			{ '		abs(15 + sqrt(1 - 15^2)	-	[(360° mod 2•#pi)	]	)		',
				'(abs(15+(1-15^2)-(360*3.1415926535898/180)mod(2*3.1415926535898)))' }
		},
	},
	replaceWithSymbol = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, '' },
			{ 'abs(#phi + sqrt(1 - #e^2)	-	[(#gamma mod 2•#pi)	]	)',
				'abs(φ + sqrt(1 - e^2)	-	[(γ mod 2•π)	]	)' }
		},
	},
	round = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.round(num) or p.round(num, multiple)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.round(num) or p.round(num, multiple)')) },
			{ '123.456', '123.456' },
			{ '123.456|0.5', '123.5' },
			{ '-123.456|0.5', '−123.5' },
			{ '-12345678910111213.141516|0.5', '−1.2345678910111E+16' },
			{ '1|0.1', '1' },
			{ '0.5|2', '0' },
			{ '2.99|2', '2'},
			{ '3|2', '4' },
			{ '0.6|0.01', '0.6' },
			{ '80|1', '80' },
		},
	},
	sin = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.sin(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.sin(num)')) },
			{ '#pi/2', '1' },
		},
	},
	sinh = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.sinh(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.sinh(num)')) },
			{ '#pi/2', '2.3012989023073' },
		},
	},
	sqrt = {
		options = {
			mode = 'invocation',
			nowiki = nw,
			preprocess = true,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.sqrt(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.sqrt(num)')) },
			{ '7', '{{#expr:7^0.5}}' },
			{ '-7', '{{#expr:7^0.5}}' },
		},
	},
	sub = {
		options = {
			mode = 'method',
			nowiki = nw,
			unpk = true,
			deep = true,
		},
		tests = {
			{ {}, (notEnoughOperands:gsub('$1', 'p.sub(n, m)')) },
			{ {321}, (notEnoughOperands:gsub('$1', 'p.sub(n, m)')) },
			{ {nil, 123}, (notEnoughOperands:gsub('$1', 'p.sub(n, m)')) },
			{ {321, 123}, 198 },
			{ {321, true}, 320 },
			{ {false, 123}, false },
			{ {true, true}, true },
			{ {321, '123'}, 198 },
			{ {'321', 123}, '198' },
			{ {'321', '123'}, '198' },
			{ {321, {100, 20, 3}}, 198 },
			{ {{321, 322, 323}, 123}, {198, 199, 200} },
			{ {{321, 654, 987}, {123, 456, 789}}, {198, 198, 198} },
		},
	},
	sum = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.sum(num1, num2, num3, ...)')) },
			{ '|2|3|5||11', '21' },
			{ '0.3872|0.3872|0.2256', '1' },
		},
	},
	tan = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.tan(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.tan(num)')) },
			{ '#pi/4', '1' },
		},
	},
	tanh = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.tanh(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.tanh(num)')) },
			{ '#pi/4', '0.65579420263267' },
		},
	},
	trunc = {
		options = {
			mode = 'invocation',
			nowiki = nw,
		},
		tests = {
			{ nil, (notEnoughOperands:gsub('$1', 'p.trunc(num)')) },
			{ '', (notEnoughOperands:gsub('$1', 'p.trunc(num)')) },
			{ '-123.456', '-123' },
		},
	},
};
Advertisement