mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
972 B
972 B
Function dotPow
Calculates the power of x to y element wise.
Syntax
math.dotPow(x, y)
Parameters
| Parameter | Type | Description |
|---|---|---|
x |
number | BigNumber | Complex | Unit | Array | Matrix | The base |
y |
number | BigNumber | Complex | Unit | Array | Matrix | The exponent |
Returns
| Type | Description |
|---|---|
| number | BigNumber | Complex | Unit | Array | Matrix | The value of x to the power y |
Examples
math.dotPow(2, 3) // returns number 8
const a = [[1, 2], [4, 3]]
math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]]
math.pow(a, 2) // returns Array [[9, 8], [16, 17]]