Added documentation for arithmetic instructions
This commit is contained in:
parent
933f194726
commit
e11efb01b9
10 changed files with 304 additions and 5 deletions
32
docs/instructions/arithmetic/absolute.md
Normal file
32
docs/instructions/arithmetic/absolute.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# abs
|
||||
|
||||
Returns the absolute value of a number.
|
||||
|
||||
## Parameters
|
||||
|
||||
* value (`integer`, `float`, `double`) - The number to get the absolute value of.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the absolute value.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "abs",
|
||||
"_": {
|
||||
"value": 10
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
|
@ -1,11 +1,11 @@
|
|||
# divide
|
||||
# div
|
||||
|
||||
Divide two numbers.
|
||||
|
||||
## Parameters
|
||||
|
||||
* a (`integer`, `float`, `double`, `instruction`) - The number to divide.
|
||||
* b (`integer`, `float`, `double`, `instruction`) - The number to divide by.
|
||||
* a (`integer`, `float`, `double`) - The number to divide.
|
||||
* b (`integer`, `float`, `double`) - The number to divide by.
|
||||
|
||||
## Return
|
||||
|
||||
|
@ -21,7 +21,7 @@ Divide two numbers.
|
|||
|
||||
```json
|
||||
{
|
||||
"type": "divide",
|
||||
"type": "div",
|
||||
"_": {
|
||||
"a": 10,
|
||||
"b": 2
|
||||
|
@ -31,5 +31,5 @@ Divide two numbers.
|
|||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 26th, 2022.
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
32
docs/instructions/arithmetic/floor.md
Normal file
32
docs/instructions/arithmetic/floor.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# floor
|
||||
|
||||
Returns the floor value of a number.
|
||||
|
||||
## Parameters
|
||||
|
||||
* value (`integer`, `float`, `double`) - The number to get the floor value of.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the floor value.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "floor",
|
||||
"_": {
|
||||
"value": 10.5
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
34
docs/instructions/arithmetic/modulo.md
Normal file
34
docs/instructions/arithmetic/modulo.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# mod
|
||||
|
||||
Calculates the remainder of a division operation.
|
||||
|
||||
## Parameters
|
||||
|
||||
* a (`integer`, `float`, `double`) - The number to divide.
|
||||
* b (`integer`, `float`, `double`) - The number to divide by.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the modulo operation.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "mod",
|
||||
"_": {
|
||||
"a": 10,
|
||||
"b": 3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
34
docs/instructions/arithmetic/multiply.md
Normal file
34
docs/instructions/arithmetic/multiply.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# mul
|
||||
|
||||
Calculates the multiplication of two numbers.
|
||||
|
||||
## Parameters
|
||||
|
||||
* a (`integer`, `float`, `double`) - The number to multiply.
|
||||
* b (`integer`, `float`, `double`) - The number to multiply by.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the multiplication.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "mul",
|
||||
"_": {
|
||||
"a": 10,
|
||||
"b": 3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
34
docs/instructions/arithmetic/power.md
Normal file
34
docs/instructions/arithmetic/power.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# pow
|
||||
|
||||
Calculates the power of a number.
|
||||
|
||||
## Parameters
|
||||
|
||||
* a (`integer`, `float`, `double`) - The number to raise to a power.
|
||||
* b (`integer`, `float`, `double`) - The power to raise the number to.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the power calculation.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "pow",
|
||||
"_": {
|
||||
"a": 2,
|
||||
"b": 3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
33
docs/instructions/arithmetic/round.md
Normal file
33
docs/instructions/arithmetic/round.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
# round
|
||||
|
||||
Rounds a number to a given precision.
|
||||
|
||||
## Parameters
|
||||
|
||||
* value (`integer`, `float`, `double`) - The number to round.
|
||||
* precision (`integer`) - The number of decimal places to round to. (default: 0)
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the rounding.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "abs",
|
||||
"_": {
|
||||
"value": 10
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
32
docs/instructions/arithmetic/square_root.md
Normal file
32
docs/instructions/arithmetic/square_root.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# square_root
|
||||
|
||||
Calculates the square root of a number.
|
||||
|
||||
## Parameters
|
||||
|
||||
* value (`integer`, `float`, `double`) - The number to calculate the square root of.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the square root calculation.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "square_root",
|
||||
"_": {
|
||||
"value": 4
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
34
docs/instructions/arithmetic/subtract.md
Normal file
34
docs/instructions/arithmetic/subtract.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# sub
|
||||
|
||||
Subtract two numbers.
|
||||
|
||||
## Parameters
|
||||
|
||||
* a (`integer`, `float`, `double`) - The number to subtract from.
|
||||
* b (`integer`, `float`, `double`) - The number to subtract.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the subtraction.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "sub",
|
||||
"_": {
|
||||
"a": 10,
|
||||
"b": 2
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
34
docs/instructions/arithmetic/sum.md
Normal file
34
docs/instructions/arithmetic/sum.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# sum
|
||||
|
||||
Calculates the sum of two numbers.
|
||||
|
||||
## Parameters
|
||||
|
||||
* a (`integer`, `float`, `double`) - The first number to add.
|
||||
* b (`integer`, `float`, `double`) - The second number to add.
|
||||
|
||||
## Return
|
||||
|
||||
(`integer`, `float`, `double`) - The result of the addition.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "sum",
|
||||
"_": {
|
||||
"a": 10,
|
||||
"b": 2
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 30th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
Loading…
Add table
Reference in a new issue