mathex
Extended mathematical library
Import
math <- fat.extra.mathex
Recommendation
Import this library instead of fat.math
, like math <- fat.extra.mathex
, as it includes the other math functions automatically.
Methods
Name | Signature | Brief |
---|---|---|
fact | (x: Number): Number | Return the factorial of x |
logN | (x: Number, base: Number): Number | Return logarithm of x with specified base |
exp | (x: Number): Number | Return e raised to the power of x |
tan | (x: Number): Number | Return the tangent of x |
sinh | (x: Number): Number | Return the hyperbolic sine of x |
cosh | (x: Number): Number | Return the hyperbolic cosine of x |
tanh | (x: Number): Number | Return the hyperbolic tangent of x |
radToDeg | (r: Number): Number | Convert radians to degrees |
degToRad | (d: Number): Number | Convert degrees to radians |
mean | (v: List/Number): Number | Return the mean of a vector |
median | (v: List/Number): Number | Return the median of a vector |
sigma | (v: List/Number): Number | Return the standard deviation of a vector |
variance | (v: List/Number): Number | Return the variance of a vector |
sigmoid | (x: Number): Number | Return the sigmoid of x |
relu | (x: Number): Number | Return the ReLU of x |
round | (x: Number): Number | Return the nearest integer to x |
Example
math <- fat.extra.mathex # named import
math.fact(5) # yields 120