diff --git a/vlib/math/bits.v b/vlib/math/bits.v index 34719fce68..e3d2bceb2c 100644 --- a/vlib/math/bits.v +++ b/vlib/math/bits.v @@ -53,6 +53,7 @@ pub fn is_inf(f f64, sign int) bool { return (sign >= 0 && f > max_f64) || (sign <= 0 && f < -max_f64) } +// is_finite returns true if f is finite pub fn is_finite(f f64) bool { return !is_nan(f) && !is_inf(f, 0) } diff --git a/vlib/math/complex/complex.v b/vlib/math/complex/complex.v index 2e6ef84c87..dc087d4f47 100644 --- a/vlib/math/complex/complex.v +++ b/vlib/math/complex/complex.v @@ -12,7 +12,7 @@ pub mut: im f64 } -// complex returns a complex struct with the given `re`al and `im`aginary parts +// complex returns a complex struct with the given `re`al and `im`aginary values pub fn complex(re f64, im f64) Complex { return Complex{re, im} } diff --git a/vlib/math/invhyp.v b/vlib/math/invhyp.v index 5884b4e5ad..0f45b4be29 100644 --- a/vlib/math/invhyp.v +++ b/vlib/math/invhyp.v @@ -1,8 +1,8 @@ module math import math.internal -// acosh returns the non negative area hyperbolic cosine of x +// acosh returns the non-negative area hyperbolic cosine of x pub fn acosh(x f64) f64 { if x == 0.0 { return 0.0 diff --git a/vlib/math/stats/stats.v b/vlib/math/stats/stats.v index b51f1b87ca..05a0901db1 100644 --- a/vlib/math/stats/stats.v +++ b/vlib/math/stats/stats.v @@ -469,6 +469,9 @@ pub fn skew_mean_stddev[T](data []T, mean T, sd T) T { return skew } +// quantile calculates quantile points +// for more reference +// https://en.wikipedia.org/wiki/Quantile pub fn quantile[T](sorted_data []T, f T) T { if sorted_data.len == 0 { return T(0)