Skip to content

Commit efef5bc

Browse files
authored
math: add missing docstrings for math.log_gamma_sign and for the complex.complex constructor function (#19523)
1 parent b9a1b0c commit efef5bc

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

vlib/math/complex/complex.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub mut:
1212
im f64
1313
}
1414

15+
// complex returns a complex struct with the given `re` and `im`
1516
pub fn complex(re f64, im f64) Complex {
1617
return Complex{re, im}
1718
}
@@ -30,6 +31,7 @@ pub fn (c Complex) abs() f64 {
3031
return math.hypot(c.re, c.im)
3132
}
3233

34+
// mod returns the modulus value of `c`
3335
pub fn (c Complex) mod() f64 {
3436
return c.abs()
3537
}

vlib/math/gamma.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ pub fn log_gamma(x f64) f64 {
139139
return y
140140
}
141141

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

0 commit comments

Comments
 (0)