Skip to content

Commit

Permalink
math: add missing docstrings for math.log_gamma_sign and for the comp…
Browse files Browse the repository at this point in the history
…lex.complex constructor function (#19523)
  • Loading branch information
sudoerp committed Oct 8, 2023
1 parent b9a1b0c commit efef5bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vlib/math/complex/complex.v
Expand Up @@ -12,6 +12,7 @@ pub mut:
im f64
}

// complex returns a complex struct with the given `re` and `im`
pub fn complex(re f64, im f64) Complex {
return Complex{re, im}
}
Expand All @@ -30,6 +31,7 @@ pub fn (c Complex) abs() f64 {
return math.hypot(c.re, c.im)
}

// mod returns the modulus value of `c`
pub fn (c Complex) mod() f64 {
return c.abs()
}
Expand Down
1 change: 1 addition & 0 deletions vlib/math/gamma.v
Expand Up @@ -139,6 +139,7 @@ pub fn log_gamma(x f64) f64 {
return y
}

// log_gamma_sign returns the natural logarithm and sign (-1 or +1) of Gamma(x)
pub fn log_gamma_sign(a f64) (f64, int) {
mut x := a
ymin := 1.461632144968362245
Expand Down

0 comments on commit efef5bc

Please sign in to comment.