Test suite status | |
---|---|
Scribunto test cases | |
Code coverage |
Execution time: 194.1 ms
Test cases failing:
Test members missing:
none
Scribunto test cases
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|abs}} | Error: Not enough input arguments | p.abs(num). | Error: Not enough input arguments | p.abs(num). | ||
{{#invoke:math|abs}} | Error: Not enough input arguments | p.abs(num). | Error: Not enough input arguments | p.abs(num). | ||
{{#invoke:math|abs|-123.456}} | 123.456 | 123.456 | ||
{{#invoke:math|abs|123.456}} | 123.456 | 123.456 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|acos}} | Error: Not enough input arguments | p.acos(num). | Error: Not enough input arguments | p.acos(num). | ||
{{#invoke:math|acos}} | Error: Not enough input arguments | p.acos(num). | Error: Not enough input arguments | p.acos(num). | ||
{{#invoke:math|acos|1}} | 0 | 0 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
p.add() | Error: Not enough input arguments | p.add(n, m). | Error: Not enough input arguments | p.add(n, m). | ||
p.add(123) | Error: Not enough input arguments | p.add(n, m). | Error: Not enough input arguments | p.add(n, m). | ||
p.add([2] = 0.456) | Error: Not enough input arguments | p.add(n, m). | Error: Not enough input arguments | p.add(n, m). | ||
p.add(123, 0.456) | 123.456 | 123.456 | ||
p.add(123, true) | 124 | 124 | ||
p.add([2] = 123) | true | true | ||
p.add(true, true) | false | false | ||
p.add(123, "0.456") | 123.456 | 123.456 | ||
p.add("123", 0.456) | 123.456 | 123.456 | ||
p.add("123", "0.456") | 123.456 | 123.456 | ||
p.add(123, { 0.4, 0.05, 0.006 }) | 123.456 | 123.456 | ||
p.add({ 123, 124, 125 }, 0.456) | { 123.456, 124.456, 125.456 } | { 123.456, 124.456, 125.456 } | ||
p.add({ 123, 124, 125 }, { 0.456, 0.789, 0.123 }) | { 123.456, 124.789, 125.123 } | { 123.456, 124.789, 125.123 } |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|asin}} | Error: Not enough input arguments | p.asin(num). | Error: Not enough input arguments | p.asin(num). | ||
{{#invoke:math|asin}} | Error: Not enough input arguments | p.asin(num). | Error: Not enough input arguments | p.asin(num). | ||
{{#invoke:math|asin|1}} | 1.5707963267949 | 1.5707963267949 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#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). | ||
{{#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). | ||
{{#invoke:math|atan|1}} | 0.78539816339745 | 0.78539816339745 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|binomial}} | Error: Not enough input arguments | p.binomial(p, n, r). | Error: Not enough input arguments | p.binomial(p, n, r). | ||
{{#invoke:math|binomial}} | Error: Not enough input arguments | p.binomial(p, n, r). | Error: Not enough input arguments | p.binomial(p, n, r). | ||
{{#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). | ||
{{#invoke:math|binomial||2}} | Error: Not enough input arguments | p.binomial(p, n, r). | Error: Not enough input arguments | p.binomial(p, n, r). | ||
{{#invoke:math|binomial|||2}} | Error: Not enough input arguments | p.binomial(p, n, r). | Error: Not enough input arguments | p.binomial(p, n, r). | ||
{{#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). | ||
{{#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). | ||
{{#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). | ||
{{#invoke:math|binomial|1/6|6|1}} | 0.40187757201646 | 0.40187757201646 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|ceil}} | Error: Not enough input arguments | p.ceil(num). | Error: Not enough input arguments | p.ceil(num). | ||
{{#invoke:math|ceil}} | Error: Not enough input arguments | p.ceil(num). | Error: Not enough input arguments | p.ceil(num). | ||
{{#invoke:math|ceil|123.456}} | 124 | 124 | ||
{{#invoke:math|ceil|-123.456}} | -123 | -123 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|cos}} | Error: Not enough input arguments | p.cos(num). | Error: Not enough input arguments | p.cos(num). | ||
{{#invoke:math|cos}} | Error: Not enough input arguments | p.cos(num). | Error: Not enough input arguments | p.cos(num). | ||
{{#invoke:math|cos|#pi/2}} | 0 | 0 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|cosh}} | Error: Not enough input arguments | p.cosh(num). | Error: Not enough input arguments | p.cosh(num). | ||
{{#invoke:math|cosh}} | Error: Not enough input arguments | p.cosh(num). | Error: Not enough input arguments | p.cosh(num). | ||
{{#invoke:math|cosh|#pi/2}} | 2.5091784786581 | 2.5091784786581 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|deg}} | Error: Not enough input arguments | p.deg(num). | Error: Not enough input arguments | p.deg(num). | ||
{{#invoke:math|deg}} | Error: Not enough input arguments | p.deg(num). | Error: Not enough input arguments | p.deg(num). | ||
{{#invoke:math|deg|#pi/4}} | 45 | 45 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
p.div() | Error: Not enough input arguments | p.div(n, m). | Error: Not enough input arguments | p.div(n, m). | ||
p.div(123) | Error: Not enough input arguments | p.div(n, m). | Error: Not enough input arguments | p.div(n, m). | ||
p.div([2] = 3) | Error: Not enough input arguments | p.div(n, m). | Error: Not enough input arguments | p.div(n, m). | ||
p.div(123, 3) | 41 | 41 | ||
p.div(123, true) | 123 | 123 | ||
p.div([2] = 123) | 0 | 0 | ||
p.div(true, true) | 1 | 1 | ||
p.div(123, "3") | 41 | 41 | ||
p.div("123", 3) | 41 | 41 | ||
p.div("123", "3") | 41 | 41 | ||
p.div(123, { 0.5, 1, 1.5 }) | 41 | 41 | ||
p.div({ 123, 126, 129 }, 3) | { 41, 42, 43 } | { 41, 42, 43 } | ||
p.div({ 123, 124, 125 }, { 3, 4, 5 }) | { 41, 31, 25 } | { 41, 31, 25 } |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|eval}} | Error: Not enough input arguments | p.eval(num). | Error: Not enough input arguments | p.eval(num). | ||
{{#invoke:math|eval}} | Error: Not enough input arguments | p.eval(num). | Error: Not enough input arguments | p.eval(num). | ||
{{#invoke:math|eval|-10 + 50 - 10^2 * 5 / 6}} | -43.333333333333 | -43.333333333333 | ||
{{#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 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|ex}} | Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...). | Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...). | ||
{{#invoke:math|ex}} | Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...). | Error: Not enough input arguments | p.ex(prob1, prob2, prob3, ...). | ||
{{#invoke:math|ex|1/6}} | 5 – 6 | 5 – 6 | ||
{{#invoke:math|ex|0.3872|0.3872|0.2256}} | 6 – 7 | 6 – 7 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|exp}} | 2.718281828459 | 2.718281828459 | ||
{{#invoke:math|exp}} | 2.718281828459 | 2.718281828459 | ||
{{#invoke:math|exp|3}} | 20.085536923188 | 20.085536923188 | ||
{{#invoke:math|exp|-3}} | 0.049787068367864 | 0.049787068367864 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|floor}} | Error: Not enough input arguments | p.floor(num). | Error: Not enough input arguments | p.floor(num). | ||
{{#invoke:math|floor}} | Error: Not enough input arguments | p.floor(num). | Error: Not enough input arguments | p.floor(num). | ||
{{#invoke:math|floor|123.456}} | 123 | 123 | ||
{{#invoke:math|floor|-123.456}} | -124 | -124 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#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). | ||
{{#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). | ||
{{#invoke:math|formatnum|-123456789.87654}} | −123,456,789.87654 | −123,456,789.87654 | ||
{{#invoke:math|formatnum|-123456789.87654321|ar}} | −١٢٣٬٤٥٦٬٧٨٩٫٨٧٦٥٤ | −١٢٣٬٤٥٦٬٧٨٩٫٨٧٦٥٤ | ||
{{#invoke:math|formatnum|-123456789.87654||true}} | −123456789.87654 | −123456789.87654 | ||
{{#invoke:math|formatnum|-123456789.87654321|ar|true}} | −١٢٣٤٥٦٧٨٩.٨٧٦٥٤ | −١٢٣٤٥٦٧٨٩.٨٧٦٥٤ |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#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). | ||
{{#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). | ||
{{#invoke:math|frac|1/6}} | \frac{\text{1}}{\text{6}}\! | \frac{\text{1}}{\text{6}}\! | ||
{{#invoke:math|frac|2.1142191999126|#e}} | \frac{\text{7}}{\text{9}}\!e | \frac{\text{7}}{\text{9}}\!e | ||
{{#invoke:math|frac|9.8994949366117||-10}} | \frac{\text{39398990}}{\text{3979899}}\! | \frac{\text{39398990}}{\text{3979899}}\! |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|gamma}} | Error: Not enough input arguments | p.gamma(num). | Error: Not enough input arguments | p.gamma(num). | ||
{{#invoke:math|gamma}} | Error: Not enough input arguments | p.gamma(num). | Error: Not enough input arguments | p.gamma(num). | ||
{{#invoke:math|gamma|2}} | 1 | 1 | ||
{{#invoke:math|gamma|#pi}} | 2.2880378 | 2.2880378 | ||
{{#invoke:math|gamma|1/2}} | 1.7724538 | 1.7724538 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|gcd}} | Error: Not enough input arguments | p.gcd(num1, num2). | Error: Not enough input arguments | p.gcd(num1, num2). | ||
{{#invoke:math|gcd||6}} | Error: Not enough input arguments | p.gcd(num1, num2). | Error: Not enough input arguments | p.gcd(num1, num2). | ||
{{#invoke:math|gcd|15}} | Error: Not enough input arguments | p.gcd(num1, num2). | Error: Not enough input arguments | p.gcd(num1, num2). | ||
{{#invoke:math|gcd|15|6}} | 3 | 3 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|ln}} | Error: Not enough input arguments | p.ln(num). | Error: Not enough input arguments | p.ln(num). | ||
{{#invoke:math|ln}} | Error: Not enough input arguments | p.ln(num). | Error: Not enough input arguments | p.ln(num). | ||
{{#invoke:math|ln|7}} | 1.9459101490553 | 1.9459101490553 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#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). | ||
{{#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). | ||
{{#invoke:math|log|7}} | 0.84509804001426 | 0.84509804001426 | ||
{{#invoke:math|log|7|3}} | 1.7712437491614 | 1.7712437491614 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|max}} | Error: Not enough input arguments | p.max(num1, num2, num3, ...). | Error: Not enough input arguments | p.max(num1, num2, num3, ...). | ||
{{#invoke:math|max}} | Error: Not enough input arguments | p.max(num1, num2, num3, ...). | Error: Not enough input arguments | p.max(num1, num2, num3, ...). | ||
{{#invoke:math|max|-2|-1|0|1|2}} | 2 | 2 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|min}} | Error: Not enough input arguments | p.min(num1, num2, num3, ...). | Error: Not enough input arguments | p.min(num1, num2, num3, ...). | ||
{{#invoke:math|min}} | Error: Not enough input arguments | p.min(num1, num2, num3, ...). | Error: Not enough input arguments | p.min(num1, num2, num3, ...). | ||
{{#invoke:math|min|-2|-1|0|1|2}} | -2 | -2 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|mod}} | Error: Not enough input arguments | p.mod(num, den). | Error: Not enough input arguments | p.mod(num, den). | ||
{{#invoke:math|mod}} | Error: Not enough input arguments | p.mod(num, den). | Error: Not enough input arguments | p.mod(num, den). | ||
{{#invoke:math|mod|67}} | Error: Not enough input arguments | p.mod(num, den). | Error: Not enough input arguments | p.mod(num, den). | ||
{{#invoke:math|mod|67|5}} | 2 | 2 | ||
{{#invoke:math|mod|-67|5}} | -2 | -2 | ||
{{#invoke:math|mod|67|-5}} | 2 | 2 | ||
{{#invoke:math|mod|-67|-5}} | -2 | -2 | ||
{{#invoke:math|mod||5}} | Error: Not enough input arguments | p.mod(num, den). | Error: Not enough input arguments | p.mod(num, den). |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|modf}} | Error: Not enough input arguments | p.modf(num). | Error: Not enough input arguments | p.modf(num). | ||
{{#invoke:math|modf}} | Error: Not enough input arguments | p.modf(num). | Error: Not enough input arguments | p.modf(num). | ||
{{#invoke:math|modf|-7}} | -0 | -0 | ||
{{#invoke:math|modf|2.33333333}} | 0.33333333 | 0.33333333 | ||
{{#invoke:math|modf|-7|int=y}} | -7 | -7 | ||
{{#invoke:math|modf|2.33333333|int=true}} | 2 | 2 | ||
{{#invoke:math|modf|-7|int=y|dec=t}} | -7-0 | -7-0 | ||
{{#invoke:math|modf|2.33333333|int=true|dec=1}} | 20.33333333 | 20.33333333 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
p.mul() | Error: Not enough input arguments | p.mul(n, m). | Error: Not enough input arguments | p.mul(n, m). | ||
p.mul(123) | Error: Not enough input arguments | p.mul(n, m). | Error: Not enough input arguments | p.mul(n, m). | ||
p.mul([2] = 3) | Error: Not enough input arguments | p.mul(n, m). | Error: Not enough input arguments | p.mul(n, m). | ||
p.mul(41, 3) | 123 | 123 | ||
p.mul(41, true) | 41 | 41 | ||
p.mul([2] = 41) | false | false | ||
p.mul(true, true) | true | true | ||
p.mul(41, "3") | 123 | 123 | ||
p.mul("41", 3) | 123 | 123 | ||
p.mul("41", "3") | 123 | 123 | ||
p.mul(41, { 0.5, 1, 1.5 }) | 123 | 123 | ||
p.mul({ 41, 42, 43 }, 3) | { 123, 126, 129 } | { 123, 126, 129 } | ||
p.mul({ 41, 31, 25 }, { 3, 4, 5 }) | { 123, 124, 125 } | { 123, 124, 125 } |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|ncr}} | Error: Not enough input arguments | p.ncr(n, r). | Error: Not enough input arguments | p.ncr(n, r). | ||
{{#invoke:math|ncr}} | Error: Not enough input arguments | p.ncr(n, r). | Error: Not enough input arguments | p.ncr(n, r). | ||
{{#invoke:math|ncr|7}} | Error: Not enough input arguments | p.ncr(n, r). | Error: Not enough input arguments | p.ncr(n, r). | ||
{{#invoke:math|ncr|7|3}} | 35 | 35 | ||
{{#invoke:math|ncr||3}} | Error: Not enough input arguments | p.ncr(n, r). | Error: Not enough input arguments | p.ncr(n, r). |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|ng}} | Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...). | Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...). | ||
{{#invoke:math|ng}} | Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...). | Error: Not enough input arguments | p.ng(prob1, prob2, prob3, ...). | ||
{{#invoke:math|ng|1/6}} | 38 ± 13 | 38 ± 13 | ||
{{#invoke:math|ng|0.3872|0.3872|0.2256}} | 27 ± 9 | 27 ± 9 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|npr}} | Error: Not enough input arguments | p.npr(n, r). | Error: Not enough input arguments | p.npr(n, r). | ||
{{#invoke:math|npr}} | Error: Not enough input arguments | p.npr(n, r). | Error: Not enough input arguments | p.npr(n, r). | ||
{{#invoke:math|npr|7}} | Error: Not enough input arguments | p.npr(n, r). | Error: Not enough input arguments | p.npr(n, r). | ||
{{#invoke:math|npr|7|3}} | 210 | 210 | ||
{{#invoke:math|npr||3}} | Error: Not enough input arguments | p.npr(n, r). | Error: Not enough input arguments | p.npr(n, r). |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|percentage}} | Error: Not enough input arguments | p.percentage(num). | Error: Not enough input arguments | p.percentage(num). | ||
{{#invoke:math|percentage}} | Error: Not enough input arguments | p.percentage(num). | Error: Not enough input arguments | p.percentage(num). | ||
{{#invoke:math|percentage|0}} | 0% | 0% | ||
{{#invoke:math|percentage|1}} | 100% | 100% | ||
{{#invoke:math|percentage|1.00000000000001}} | 100% | 100% | ||
{{#invoke:math|percentage|1.5}} | 150% | 150% | ||
{{#invoke:math|percentage|0.5}} | 50% | 50% | ||
{{#invoke:math|percentage|0.5000}} | 50% | 50% | ||
{{#invoke:math|percentage|0.9999}} | 99.99% | 99.99% | ||
{{#invoke:math|percentage|0.999999}} | 100% | 100% |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|pow}} | Error: Not enough input arguments | p.pow(base, exponent). | Error: Not enough input arguments | p.pow(base, exponent). | ||
{{#invoke:math|pow}} | Error: Not enough input arguments | p.pow(base, exponent). | Error: Not enough input arguments | p.pow(base, exponent). | ||
{{#invoke:math|pow|7}} | Error: Not enough input arguments | p.pow(base, exponent). | Error: Not enough input arguments | p.pow(base, exponent). | ||
{{#invoke:math|pow|7|3}} | 343 | 343 | ||
{{#invoke:math|pow|-7|3}} | -343 | -343 | ||
{{#invoke:math|pow|7|-3}} | 0.0029154518950437 | 0.0029154518950437 | ||
{{#invoke:math|pow|-7|-3}} | -0.0029154518950437 | -0.0029154518950437 | ||
{{#invoke:math|pow||3}} | Error: Not enough input arguments | p.pow(base, exponent). | Error: Not enough input arguments | p.pow(base, exponent). |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|rad}} | Error: Not enough input arguments | p.rad(num). | Error: Not enough input arguments | p.rad(num). | ||
{{#invoke:math|rad}} | Error: Not enough input arguments | p.rad(num). | Error: Not enough input arguments | p.rad(num). | ||
{{#invoke:math|rad|45}} | 0.78539816339745 | 0.78539816339745 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|rand|||seed=0}} | 0.90337034822599_0 | 0.90337034822599_0 | ||
{{#invoke:math|rand|100||seed=0}} | 91_0 | 91_0 | ||
{{#invoke:math|rand|-20|50|seed=0}} | 44_0 | 44_0 | ||
{{#invoke:math|rand|50|-20|seed=0}} | 44_0 | 44_0 | ||
{{#invoke:math|rand||100|seed=0}} | 0.90337034822599_0 | 0.90337034822599_0 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|replace}} | () | () | ||
{{#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))) |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|replaceWithSymbol}} | ||||
{{#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•π) ] ) |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#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). | ||
{{#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). | ||
{{#invoke:math|round|123.456}} | 123.456 | 123.456 | ||
{{#invoke:math|round|123.456|0.5}} | 123.5 | 123.5 | ||
{{#invoke:math|round|-123.456|0.5}} | −123.5 | −123.5 | ||
{{#invoke:math|round|-12345678910111213.141516|0.5}} | −1.2345678910111E+16 | −1.2345678910111×1016 | 2 " " vs. "1 " | |
{{#invoke:math|round|1|0.1}} | 1 | 1 | ||
{{#invoke:math|round|0.5|2}} | 0 | 0 | ||
{{#invoke:math|round|2.99|2}} | 2 | 2 | ||
{{#invoke:math|round|3|2}} | 4 | 4 | ||
{{#invoke:math|round|0.6|0.01}} | 0.6 | 0.6 | ||
{{#invoke:math|round|80|1}} | 80 | 80 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|sin}} | Error: Not enough input arguments | p.sin(num). | Error: Not enough input arguments | p.sin(num). | ||
{{#invoke:math|sin}} | Error: Not enough input arguments | p.sin(num). | Error: Not enough input arguments | p.sin(num). | ||
{{#invoke:math|sin|#pi/2}} | 1 | 1 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|sinh}} | Error: Not enough input arguments | p.sinh(num). | Error: Not enough input arguments | p.sinh(num). | ||
{{#invoke:math|sinh}} | Error: Not enough input arguments | p.sinh(num). | Error: Not enough input arguments | p.sinh(num). | ||
{{#invoke:math|sinh|#pi/2}} | 2.3012989023073 | 2.3012989023073 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|sqrt}} | Error: Not enough input arguments | p.sqrt(num). | Error: Not enough input arguments | p.sqrt(num). | ||
{{#invoke:math|sqrt}} | Error: Not enough input arguments | p.sqrt(num). | Error: Not enough input arguments | p.sqrt(num). | ||
{{#invoke:math|sqrt|7}} | 2.6457513110646 | 2.6457513110646 | ||
{{#invoke:math|sqrt|-7}} | 2.6457513110646 | 2.6457513110646 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
p.sub() | Error: Not enough input arguments | p.sub(n, m). | Error: Not enough input arguments | p.sub(n, m). | ||
p.sub(321) | Error: Not enough input arguments | p.sub(n, m). | Error: Not enough input arguments | p.sub(n, m). | ||
p.sub([2] = 123) | Error: Not enough input arguments | p.sub(n, m). | Error: Not enough input arguments | p.sub(n, m). | ||
p.sub(321, 123) | 198 | 198 | ||
p.sub(321, true) | 320 | 320 | ||
p.sub([2] = 123) | false | false | ||
p.sub(true, true) | true | true | ||
p.sub(321, "123") | 198 | 198 | ||
p.sub("321", 123) | 198 | 198 | ||
p.sub("321", "123") | 198 | 198 | ||
p.sub(321, { 100, 20, 3 }) | 198 | 198 | ||
p.sub({ 321, 322, 323 }, 123) | { 198, 199, 200 } | { 198, 199, 200 } | ||
p.sub({ 321, 654, 987 }, { 123, 456, 789 }) | { 198, 198, 198 } | { 198, 198, 198 } |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|sum}} | Error: Not enough input arguments | p.sum(num1, num2, num3, ...). | Error: Not enough input arguments | p.sum(num1, num2, num3, ...). | ||
{{#invoke:math|sum||2|3|5||11}} | 21 | 21 | ||
{{#invoke:math|sum|0.3872|0.3872|0.2256}} | 1 | 1 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|tan}} | Error: Not enough input arguments | p.tan(num). | Error: Not enough input arguments | p.tan(num). | ||
{{#invoke:math|tan}} | Error: Not enough input arguments | p.tan(num). | Error: Not enough input arguments | p.tan(num). | ||
{{#invoke:math|tan|#pi/4}} | 1 | 1 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|tanh}} | Error: Not enough input arguments | p.tanh(num). | Error: Not enough input arguments | p.tanh(num). | ||
{{#invoke:math|tanh}} | Error: Not enough input arguments | p.tanh(num). | Error: Not enough input arguments | p.tanh(num). | ||
{{#invoke:math|tanh|#pi/4}} | 0.65579420263267 | 0.65579420263267 |
| ||||
---|---|---|---|---|
Status | Code | Expected | Actual | Differs at |
{{#invoke:math|trunc}} | Error: Not enough input arguments | p.trunc(num). | Error: Not enough input arguments | p.trunc(num). | ||
{{#invoke:math|trunc}} | Error: Not enough input arguments | p.trunc(num). | Error: Not enough input arguments | p.trunc(num). | ||
{{#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' },
},
},
};