mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
math: fix typo in factorial.v (#17322)
This commit is contained in:
parent
5d4c9dc9fc
commit
2382549df3
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@ module math
|
|||
|
||||
// factorial calculates the factorial of the provided value.
|
||||
pub fn factorial(n f64) f64 {
|
||||
// For a large postive argument (n >= factorials_table.len) return max_f64
|
||||
// For a large positive argument (n >= factorials_table.len) return max_f64
|
||||
if n >= factorials_table.len {
|
||||
return max_f64
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ pub fn factorial(n f64) f64 {
|
|||
|
||||
// log_factorial calculates the log-factorial of the provided value.
|
||||
pub fn log_factorial(n f64) f64 {
|
||||
// For a large postive argument (n < 0) return max_f64
|
||||
// For a large positive argument (n < 0) return max_f64
|
||||
if n < 0 {
|
||||
return -max_f64
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue