mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
16 lines
280 B
Go
16 lines
280 B
Go
import math
|
|
|
|
fn test_gcd() {
|
|
assert math.gcd(6, 9) == 3
|
|
assert math.gcd(6, -9) == 3
|
|
assert math.gcd(-6, -9) == 3
|
|
assert math.gcd(0, 0) == 0
|
|
}
|
|
|
|
fn test_lcm() {
|
|
assert math.lcm(2, 3) == 6
|
|
assert math.lcm(-2, 3) == 6
|
|
assert math.lcm(-2, -3) == 6
|
|
assert math.lcm(0, 0) == 0
|
|
}
|