math: add missing docstrings for math.log_gamma_sign and for the complex.complex constructor function (#19523)

This commit is contained in:
Sudoer 2023-10-08 14:50:48 +05:30 committed by GitHub
parent b9a1b0c269
commit efef5bcc89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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}
}
@ -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()
}

View File

@ -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