16 lines
473 B
Plaintext
16 lines
473 B
Plaintext
print("\n--- Test: math module ---");
|
|
import math;
|
|
|
|
assert(math.sqrt(9) == 3, "math.sqrt");
|
|
assert(math.round(3.6) == 4, "math.round");
|
|
assert(math.floor(3.6) == 3, "math.floor");
|
|
assert(math.ceil(3.1) == 4, "math.ceil");
|
|
assert(math.abs(-5) == 5, "math.abs");
|
|
assert(math.pow(2,8) == 256, "math.pow");
|
|
assert(math.min(1, 2, 3) == 1, "math.min");
|
|
assert(math.max(1, 2, 3) == 3, "math.max");
|
|
assert(math.pi > 3.14 && math.pi < 3.15, "math.pi range");
|
|
print("math: PASS");
|
|
|
|
|