Skip to content

Commit

Permalink
Added docs for complex fn in vlib/math/complex and gamma.v
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdot0 committed Oct 6, 2023
1 parent 4b03d08 commit d681dd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions vlib/math/complex/complex.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub mut:
im f64
}

// Return a Complex Struct with re and im
pub fn complex(re f64, im f64) Complex {
return Complex{re, im}
}
Expand Down
2 changes: 2 additions & 0 deletions vlib/math/gamma.v
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ pub fn gamma(a f64) f64 {
// log_gamma(-integer) = +inf
// log_gamma(-inf) = -inf
// log_gamma(nan) = nan
// uses log_gamma_sign internally
pub fn log_gamma(x f64) f64 {
y, _ := log_gamma_sign(x)
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 d681dd9

Please sign in to comment.