1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

math: gcd and lcm functions

This commit is contained in:
Rustem B
2019-06-29 20:24:55 +05:00
committed by Alexander Medvednikov
parent 0afcadcfd1
commit 7eab373922
2 changed files with 39 additions and 0 deletions

9
vlib/math/math_test.v Normal file
View File

@@ -0,0 +1,9 @@
import math
fn test_gcd_and_lcm() {
assert math.gcd(6, 9) == 3
assert math.gcd(6, -9) == 3
assert math.lcm(2, 3) == 6
assert math.lcm(-2, 3) == 6
}