mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
math: fix typo in factorial.v (#17322)
This commit is contained in:
parent
5d4c9dc9fc
commit
2382549df3
@ -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…
Reference in New Issue
Block a user