diff --git a/src/gleam_community/maths/arithmetics.gleam b/src/gleam_community/maths/arithmetics.gleam index ebffe30..6e46671 100644 --- a/src/gleam_community/maths/arithmetics.gleam +++ b/src/gleam_community/maths/arithmetics.gleam @@ -307,7 +307,7 @@ pub fn proper_divisors(n: Int) -> List(Int) { /// /// In the formula, $$n$$ is the length of the list and $$x_i \in \mathbb{R}$$ is /// the value in the input list indexed by $$i$$, while $$w_i \in \mathbb{R}$$ is -/// a corresponding weight ($$w_i = 1.0\;\forall i=1...n$$ by default). +/// a corresponding weight ($$w_i = 1.0\\;\forall i=1...n$$ by default). /// ///
/// Example: @@ -413,7 +413,7 @@ pub fn int_sum(arr: List(Int)) -> Int { /// /// In the formula, $$n$$ is the length of the list and $$x_i \in \mathbb{R}$$ is /// the value in the input list indexed by $$i$$, while $$w_i \in \mathbb{R}$$ is -/// a corresponding weight ($$w_i = 1.0\;\forall i=1...n$$ by default). +/// a corresponding weight ($$w_i = 1.0\\;\forall i=1...n$$ by default). /// ///
/// Example: diff --git a/src/gleam_community/maths/metrics.gleam b/src/gleam_community/maths/metrics.gleam index 2cacfb5..e722d03 100644 --- a/src/gleam_community/maths/metrics.gleam +++ b/src/gleam_community/maths/metrics.gleam @@ -130,7 +130,7 @@ fn validate_weights(warr: List(Float)) -> Result(Bool, String) { /// /// In the formula, $$n$$ is the length of the list and $$x_i$$ is the value in /// the input list indexed by $$i$$, while $$w_i \in \mathbb{R}_{+}$$ is -/// a corresponding positive weight ($$w_i = 1.0\;\forall i=1...n$$ by default). +/// a corresponding positive weight ($$w_i = 1.0\\;\forall i=1...n$$ by default). /// ///
/// Example: @@ -245,7 +245,7 @@ pub fn norm( /// In the formula, $$n$$ is the length of the two lists and $$x_i, y_i$$ are the /// values in the respective input lists indexed by $$i$$, while /// $$w_i \in \mathbb{R}_{+}$$ is a corresponding positive weight -/// ($$w_i = 1.0\;\forall i=1...n$$ by default). +/// ($$w_i = 1.0\\;\forall i=1...n$$ by default). /// ///
/// Example: @@ -305,7 +305,7 @@ pub fn manhattan_distance( /// In the formula, $$p >= 1$$ is the order, $$n$$ is the length of the two lists /// and $$x_i, y_i$$ are the values in the respective input lists indexed by $$i$$. /// $$w_i \in \mathbb{R}_{+}$$ is a corresponding positive weight -/// ($$w_i = 1.0\;\forall i=1...n$$ by default). +/// ($$w_i = 1.0\\;\forall i=1...n$$ by default). /// /// The Minkowski distance is a generalization of both the Euclidean distance /// ($$p=2$$) and the Manhattan distance ($$p = 1$$). @@ -395,7 +395,7 @@ pub fn minkowski_distance( /// In the formula, $$n$$ is the length of the two lists and $$x_i, y_i$$ are the /// values in the respective input lists indexed by $$i$$, while /// $$w_i \in \mathbb{R}_{+}$$ is a corresponding positive weight -/// ($$w_i = 1.0\;\forall i=1...n$$ by default). +/// ($$w_i = 1.0\\;\forall i=1...n$$ by default). /// ///
/// Example: @@ -1034,17 +1034,17 @@ pub fn overlap_coefficient(xset: set.Set(a), yset: set.Set(a)) -> Float { /// vectors): /// /// \\[ -/// \frac{\sum_{i=1}^n w_i \cdot x_i \cdot y_i} -/// {\left(\sum_{i=1}^n x_i^2\right)^{\frac{1}{2}} +/// \frac{\sum_{i=1}^n w_{i} \cdot x_i \cdot y_i} +/// {\left(\sum_{i=1}^n w_{i} \cdot x_i^2\right)^{\frac{1}{2}} /// \cdot -/// \left(\sum_{i=1}^n w_i y_i^2\right)^{\frac{1}{2}}} +/// \left(\sum_{i=1}^n w_{i} \cdot y_i^2\right)^{\frac{1}{2}}} /// \\; \in \\; \left[-1, 1\right] /// \\] /// /// In the formula, $$n$$ is the length of the two lists and $$x_i$$, $$y_i$$ are /// the values in the respective input lists indexed by $$i$$, while /// $$w_i \in \mathbb{R}_{+}$$ is a corresponding positive weight -/// ($$w_i = 1.0\;\forall i=1...n$$ by default). +/// ($$w_i = 1.0\\;\forall i=1...n$$ by default). /// /// The cosine similarity provides a value between -1 and 1, where 1 means the /// vectors are in the same direction, -1 means they are in exactly opposite diff --git a/src/gleam_community/maths/piecewise.gleam b/src/gleam_community/maths/piecewise.gleam index c840f25..8939dc7 100644 --- a/src/gleam_community/maths/piecewise.gleam +++ b/src/gleam_community/maths/piecewise.gleam @@ -490,7 +490,7 @@ fn do_ceiling(a: Float) -> Float /// The absolute value: /// /// \\[ -/// \forall x, y \in \mathbb{R}, \\; |x| \in \mathbb{R}_{+}. +/// \forall x \in \mathbb{R}, \\; |x| \in \mathbb{R}_{+}. /// \\] /// /// The function takes an input $$x$$ and returns a positive float value. @@ -519,7 +519,7 @@ pub fn float_absolute_value(x: Float) -> Float { /// The absolute value: /// /// \\[ -/// \forall x, y \in \mathbb{Z}, \\; |x| \in \mathbb{Z}_{+}. +/// \forall x \in \mathbb{Z}, \\; |x| \in \mathbb{Z}_{+}. /// \\] /// /// The function takes an input $$x$$ and returns a positive integer value. @@ -592,7 +592,8 @@ pub fn float_absolute_difference(a: Float, b: Float) -> Float { /// \forall x, y \in \mathbb{Z}, \\; |x - y| \in \mathbb{Z}_{+}. /// \\] /// -/// The function takes two inputs $$x$$ and $$y$$ and returns a positive integer value which is the the absolute difference of the inputs. +/// The function takes two inputs $$x$$ and $$y$$ and returns a positive integer +/// value which is the the absolute difference of the inputs. /// ///
/// Example: @@ -698,7 +699,8 @@ fn do_int_sign(a: Int) -> Int /// /// /// -/// The function takes two arguments $$x, y \in \mathbb{R}$$ and returns $$x$$ such that it has the same sign as $$y$$. +/// The function takes two arguments $$x, y \in \mathbb{R}$$ and returns $$x$$ +/// such that it has the same sign as $$y$$. /// /// /// -/// The function takes two arguments $$x, y \in \mathbb{Z}$$ and returns $$x$$ such that it has the same sign as $$y$$. +/// The function takes two arguments $$x, y \in \mathbb{Z}$$ and returns $$x$$ +/// such that it has the same sign as $$y$$. /// ///
///