Skip to content

Commit 65dd69c

Browse files
authored
math: add missing docstrings for vlib/math functions (#19617)
1 parent c526c6f commit 65dd69c

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

vlib/math/bits.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub fn is_inf(f f64, sign int) bool {
5353
return (sign >= 0 && f > max_f64) || (sign <= 0 && f < -max_f64)
5454
}
5555

56+
// is_finite returns true if f is finite
5657
pub fn is_finite(f f64) bool {
5758
return !is_nan(f) && !is_inf(f, 0)
5859
}

vlib/math/complex/complex.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub mut:
1212
im f64
1313
}
1414

15-
// complex returns a complex struct with the given `re`al and `im`aginary parts
15+
// complex returns a complex struct with the given `re`al and `im`aginary values
1616
pub fn complex(re f64, im f64) Complex {
1717
return Complex{re, im}
1818
}

vlib/math/invhyp.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module math
22

33
import math.internal
4-
// acosh returns the non negative area hyperbolic cosine of x
54

5+
// acosh returns the non-negative area hyperbolic cosine of x
66
pub fn acosh(x f64) f64 {
77
if x == 0.0 {
88
return 0.0

vlib/math/stats/stats.v

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ pub fn skew_mean_stddev[T](data []T, mean T, sd T) T {
469469
return skew
470470
}
471471

472+
// quantile calculates quantile points
473+
// for more reference
474+
// https://en.wikipedia.org/wiki/Quantile
472475
pub fn quantile[T](sorted_data []T, f T) T {
473476
if sorted_data.len == 0 {
474477
return T(0)

0 commit comments

Comments
 (0)