mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib/math: Add a pure V backend for vlib/math (#11267)
This commit is contained in:

committed by
GitHub

parent
dd486bb0fb
commit
1cfc4198f5
13
vlib/math/factorial_test.v
Normal file
13
vlib/math/factorial_test.v
Normal file
@ -0,0 +1,13 @@
|
||||
module math
|
||||
|
||||
fn test_factorial() {
|
||||
assert factorial(12) == 479001600
|
||||
assert factorial(5) == 120
|
||||
assert factorial(0) == 1
|
||||
}
|
||||
|
||||
fn test_log_factorial() {
|
||||
assert log_factorial(12) == log(479001600)
|
||||
assert log_factorial(5) == log(120)
|
||||
assert log_factorial(0) == log(1)
|
||||
}
|
Reference in New Issue
Block a user