2019-06-29 17:24:55 +02:00
|
|
|
import math
|
|
|
|
|
2019-06-29 22:49:57 +02:00
|
|
|
fn test_gcd() {
|
2019-06-29 17:24:55 +02:00
|
|
|
assert math.gcd(6, 9) == 3
|
|
|
|
assert math.gcd(6, -9) == 3
|
2019-06-29 22:49:57 +02:00
|
|
|
assert math.gcd(-6, -9) == 3
|
|
|
|
assert math.gcd(0, 0) == 0
|
|
|
|
}
|
2019-06-29 17:24:55 +02:00
|
|
|
|
2019-06-29 22:49:57 +02:00
|
|
|
fn test_lcm() {
|
2019-06-29 17:24:55 +02:00
|
|
|
assert math.lcm(2, 3) == 6
|
|
|
|
assert math.lcm(-2, 3) == 6
|
2019-06-29 22:49:57 +02:00
|
|
|
assert math.lcm(-2, -3) == 6
|
|
|
|
assert math.lcm(0, 0) == 0
|
2019-06-29 17:24:55 +02:00
|
|
|
}
|