mirror of
https://github.com/sigmasternchen/gleam-community-maths
synced 2025-03-15 07:59:01 +00:00
Merge pull request #7 from NicklasXYZ/main
Remove public functions that should be private
This commit is contained in:
commit
637f05232a
2 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ pub fn gcd(x: Int, y: Int) -> Int {
|
|||
do_gcd(absx, absy)
|
||||
}
|
||||
|
||||
pub fn do_gcd(x: Int, y: Int) -> Int {
|
||||
fn do_gcd(x: Int, y: Int) -> Int {
|
||||
case x == 0 {
|
||||
True -> y
|
||||
False -> {
|
||||
|
@ -171,7 +171,7 @@ pub fn divisors(n: Int) -> List(Int) {
|
|||
find_divisors(n)
|
||||
}
|
||||
|
||||
pub fn find_divisors(n: Int) -> List(Int) {
|
||||
fn find_divisors(n: Int) -> List(Int) {
|
||||
let nabs: Float = piecewise.float_absolute_value(conversion.int_to_float(n))
|
||||
let assert Ok(sqrt_result) = elementary.square_root(nabs)
|
||||
let max: Int = conversion.float_to_int(sqrt_result) + 1
|
||||
|
|
|
@ -500,7 +500,7 @@ pub fn variance(arr: List(Float), ddof: Int) -> Result(Float, String) {
|
|||
///
|
||||
/// Calculcate the sample standard deviation of the elements in a list:
|
||||
/// \\[
|
||||
/// s = \left(\frac{1}{n - d} \sum_{i=1}^{n}(x_i - \bar{x}))\right)^{\frac{1}{2}}
|
||||
/// s = \left(\frac{1}{n - d} \sum_{i=1}^{n}(x_i - \bar{x})\right)^{\frac{1}{2}}
|
||||
/// \\]
|
||||
///
|
||||
/// In the formula, $$n$$ is the sample size (the length of the list) and
|
||||
|
|
Loading…
Reference in a new issue