Module talk:Math/testcases

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

All tests passed.

Test: average
Text Expected Actual
✓[OK] {{#Invoke:math|average|5|6|7}} 6 6
✓[OK] {{#Invoke:math|average|-7}} -7 -7
✓[OK] {{#Invoke:math|average|10000000001|10000000002|10000000003}} 10000000002 10000000002
Test: max
Text Expected Actual
✓[OK] {{#Invoke:math|max|}}
✓[OK] {{#Invoke:math|max|5|6|9}} 9 9
✓[OK] {{#Invoke:math|max|-5|-6|-9}} -5 -5
Test: min
Text Expected Actual
✓[OK] {{#Invoke:math|min|}}
✓[OK] {{#Invoke:math|min|1|2|3}} 1 1
✓[OK] {{#Invoke:math|min|-1|-2|-3}} -3 -3
Test: order
Text Expected Actual
✓[OK] {{#Invoke:math|order|2}} 0 0
✓[OK] {{#Invoke:math|order|20}} 1 1
✓[OK] {{#Invoke:math|order|200}} 2 2
✓[OK] {{#Invoke:math|order|x = 5}} 0 0
✓[OK] {{#Invoke:math|order|string}} Formatting error: Order of magnitude input appears non-numeric Formatting error: Order of magnitude input appears non-numeric
Test: precison
Text Expected Actual
✓[OK] {{#Invoke:math|precision|1.9856}} 4 4
✓[OK] {{#Invoke:math|precision|1.1}} 1 1
✓[OK] {{#Invoke:math|precision|1.9999999999}} 10 10
✓[OK] {{#Invoke:math|precision|x = 1.9888}} 4 4
✓[OK] {{#Invoke:math|precision|letra}} Formatting error: Precision input appears non-numeric Formatting error: Precision input appears non-numeric
Test: precison_format
Text Expected Actual
✓[OK] {{#Invoke:math|precision_format|10|2}} 10.00 10.00
Test: random
Text Expected Actual
⚠[!] {{#Invoke:math|random}} 0.00047147460303804 0.22198432740848
⚠[!] {{#Invoke:math|random|10}} 8 6
⚠[!] {{#Invoke:math|random|1|2}} 2 1
Test: round
Text Expected Actual
✓[OK] {{#Invoke:math|round|1.99999}} 2 2
✓[OK] {{#Invoke:math|round|1.99999|0}} 2 2
✓[OK] {{#Invoke:math|round|1.94|1}} 1.9 1.9
✓[OK] {{#Invoke:math|round|15|-1}} 20 20
✓[OK] {{#Invoke:math|round|value = 2.99999|precision = 2}} 3 3