Registers the methods of the module math in microTasks.
- math
- ~math.add([Numbers]) ⇒
number
- ~math.divide([Numbers]) ⇒
number
- ~math.multiply([Numbers]) ⇒
number
- ~math.operate(operation, [args]) ⇒
number
- ~math.substract([Numbers]) ⇒
number
- ~math.add([Numbers]) ⇒
Returns: number
- Returns the sum of several numbers.
Name | Type | Description |
---|---|---|
[Numbers] | number |
List of numbers. |
Example
microTasks.taskRun([{
method: 'math.add',
params: [1, 2, 3],
resultPath: 'total'
}])
// payload.total = 6
Returns: number
- Returns the division of several numbers.
Name | Type | Description |
---|---|---|
[Numbers] | number |
List of numbers. |
Example
microTasks.taskRun([{
method: 'math.divide',
params: [24, 3, 2],
resultPath: 'total'
}])
// payload.total = 4
Returns: number
- Returns the multiplication of several numbers.
Name | Type | Description |
---|---|---|
[Numbers] | number |
List of numbers. |
Example
microTasks.taskRun([{
method: 'math.multiply',
params: [2, 3, 4],
resultPath: 'total'
}])
// payload.total = 24
Returns: number
- Returns the result of a mathematical operation, using the native library Math.
Name | Type | Description |
---|---|---|
operation | operation |
Numbers. |
[args] | args |
Arguments of the operation. |
Example
microTasks.taskRun([{
method: 'math.operate',
params: [round, 1.1], // Math.round(1.1)
resultPath: 'total'
}])
// payload.total = 1
Returns: number
- Returns the subtraction of several numbers.
Name | Type | Description |
---|---|---|
[Numbers] | number |
List of numbers. |
Example
microTasks.taskRun([{
method: 'math.substract',
params: [10, 3, 1],
resultPath: 'total'
}])
// payload.total = 6