Add sign function.

This commit is contained in:
Stephen Chung
2020-06-25 19:19:16 +08:00
parent fe640e0e13
commit 580a62daaf
2 changed files with 25 additions and 4 deletions

View File

@@ -9,10 +9,11 @@ Integer Functions
The following standard functions (defined in the [`BasicMathPackage`]({{rootUrl}}/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` |
| Function | Description |
| ------------ | --------------------------------------------------------------- |
| `abs` | absolute value |
| `sign` | returns -1 if the number is negative, +1 if positive, 0 if zero |
| [`to_float`] | converts an integer type to `f64` |
Floating-Point Functions
-----------------------