Registers the methods of the module math in microTasks.
numbernumbernumbernumbernumbernumbernumberReturns: 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
numberReturns: 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
numberReturns: 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
numberReturns: 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
numberReturns: number - Returns the number parsed to integer.
| Name | Type | Description |
|---|---|---|
| number | number |
Numbers. |
Example
microTasks.taskRun([{
method: 'math.parseInt',
params: 1.1, // parseInt(1.1)
resultPath: 'total'
}])
// payload.total = 1
numberReturns: 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