Skip to content

Commit 60a513b

Browse files
authored
Add more element-wise math functions for floats (#1507)
1 parent 744ce56 commit 60a513b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/numeric/impl_float_maths.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,16 @@ where
103103
fn exp
104104
/// `2^x` of each element.
105105
fn exp2
106+
/// `e^x - 1` of each element.
107+
fn exp_m1
106108
/// Natural logarithm of each element.
107109
fn ln
108110
/// Base 2 logarithm of each element.
109111
fn log2
110112
/// Base 10 logarithm of each element.
111113
fn log10
114+
/// `ln(1 + x)` of each element.
115+
fn ln_1p
112116
/// Cubic root of each element.
113117
fn cbrt
114118
/// Sine of each element (in radians).
@@ -117,6 +121,24 @@ where
117121
fn cos
118122
/// Tangent of each element (in radians).
119123
fn tan
124+
/// Arcsine of each element (return in radians).
125+
fn asin
126+
/// Arccosine of each element (return in radians).
127+
fn acos
128+
/// Arctangent of each element (return in radians).
129+
fn atan
130+
/// Hyperbolic sine of each element.
131+
fn sinh
132+
/// Hyperbolic cosine of each element.
133+
fn cosh
134+
/// Hyperbolic tangent of each element.
135+
fn tanh
136+
/// Inverse hyperbolic sine of each element.
137+
fn asinh
138+
/// Inverse hyperbolic cosine of each element.
139+
fn acosh
140+
/// Inverse hyperbolic tangent of each element.
141+
fn atanh
120142
/// Converts radians to degrees for each element.
121143
fn to_degrees
122144
/// Converts degrees to radians for each element.
@@ -133,6 +155,8 @@ where
133155
fn log(A)
134156
/// The positive difference between given number and each element.
135157
fn abs_sub(A)
158+
/// Length of the hypotenuse of a right-angle triangle of each element
159+
fn hypot(A)
136160
}
137161

138162
/// Square (two powers) of each element.

0 commit comments

Comments
 (0)