Add Rhai book.
This commit is contained in:
32
doc/src/language/num-fn.md
Normal file
32
doc/src/language/num-fn.md
Normal file
@@ -0,0 +1,32 @@
|
||||
Numeric Functions
|
||||
================
|
||||
|
||||
{{#include ../links.md}}
|
||||
|
||||
Integer Functions
|
||||
----------------
|
||||
|
||||
The following standard functions (defined in the [`BasicMathPackage`](/rust/packages.md) but excluded if using a [raw `Engine`])
|
||||
operate on `i8`, `i16`, `i32`, `i64`, `f32` and `f64` only:
|
||||
|
||||
| Function | Description |
|
||||
| ------------ | --------------------------------- |
|
||||
| `abs` | absolute value |
|
||||
| [`to_float`] | converts an integer type to `f64` |
|
||||
|
||||
Floating-Point Functions
|
||||
-----------------------
|
||||
|
||||
The following standard functions (defined in the [`BasicMathPackage`](/rust/packages.md) but excluded if using a [raw `Engine`])
|
||||
operate on `f64` only:
|
||||
|
||||
| Category | Functions |
|
||||
| ---------------- | --------------------------------------------------------------------- |
|
||||
| Trigonometry | `sin`, `cos`, `tan`, `sinh`, `cosh`, `tanh` in degrees |
|
||||
| Arc-trigonometry | `asin`, `acos`, `atan`, `asinh`, `acosh`, `atanh` in degrees |
|
||||
| Square root | `sqrt` |
|
||||
| Exponential | `exp` (base _e_) |
|
||||
| Logarithmic | `ln` (base _e_), `log10` (base 10), `log` (any base) |
|
||||
| Rounding | `floor`, `ceiling`, `round`, `int`, `fraction` methods and properties |
|
||||
| Conversion | [`to_int`] |
|
||||
| Testing | `is_nan`, `is_finite`, `is_infinite` methods and properties |
|
Reference in New Issue
Block a user