Implement basic integer math operations
This commit is contained in:
23
HELP.md
23
HELP.md
@@ -319,6 +319,29 @@ Append the given `value` to the current destructured.
|
||||
Example: `[foo, bar]` -> `push foo` -> `[foo, bar, foo]`
|
||||
|
||||
|
||||
### Numeric Operations
|
||||
|
||||
#### `plus <val>`
|
||||
Add `val` to the current subject.
|
||||
Example: `4` -> `add 3` -> `7`
|
||||
|
||||
#### `minus <val>`
|
||||
Subtract `val` from the current subject.
|
||||
Example: `4` -> `sub 7` -> `-3`
|
||||
|
||||
#### `abs`
|
||||
Take the absolute value of the current subject.
|
||||
Example: `-3` -> `abs` -> `3`
|
||||
|
||||
#### `times <val>`
|
||||
Multiply the current subject by `val`.
|
||||
Example: `3` -> `times 4` -> `12`
|
||||
|
||||
#### `divide <val>`
|
||||
Divide the current subject by `val`.
|
||||
Example: `12` -> `divide 3` -> `4`
|
||||
|
||||
|
||||
### Working with Variables
|
||||
|
||||
Variables in `str` start with a dollar sign and may be alphanumeric with underscores (e.g. `$my_var`).
|
||||
|
||||
Reference in New Issue
Block a user