mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.
45 lines (27 loc) • 1.03 kB
Markdown
# Function dotPow
Calculates the power of x to y element wise.
## Syntax
```js
math.dotPow(x, y)
```
### Parameters
Parameter | Type | Description
--------- | ---- | -----------
`x` | Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | null | The base
`y` | Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | null | The exponent
### Returns
Type | Description
---- | -----------
Number | BigNumber | Complex | Unit | Array | Matrix | The value of `x` to the power `y`
## Examples
```js
math.dotPow(2, 3); // returns Number 8
var 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]]
```
## See also
[pow](pow.md),
[sqrt](sqrt.md),
[multiply](multiply.md)
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->