From efef5bcc8958e4305d5d89c424a4791a80b0babd Mon Sep 17 00:00:00 2001 From: Sudoer Date: Sun, 8 Oct 2023 14:50:48 +0530 Subject: [PATCH] math: add missing docstrings for math.log_gamma_sign and for the complex.complex constructor function (#19523) --- vlib/math/complex/complex.v | 2 ++ vlib/math/gamma.v | 1 + 2 files changed, 3 insertions(+) diff --git a/vlib/math/complex/complex.v b/vlib/math/complex/complex.v index a2efbceda5d5d8..17232a513fdc74 100644 --- a/vlib/math/complex/complex.v +++ b/vlib/math/complex/complex.v @@ -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() } diff --git a/vlib/math/gamma.v b/vlib/math/gamma.v index e0061db39b4749..a00f390180eb7d 100644 --- a/vlib/math/gamma.v +++ b/vlib/math/gamma.v @@ -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