49 lines
1.0 KiB
Markdown
49 lines
1.0 KiB
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
|
|
|
# Function unaryPlus
|
|
|
|
Unary plus operation.
|
|
Boolean values and strings will be converted to a number, numeric values will be returned as is.
|
|
|
|
For matrices, the function is evaluated element wise.
|
|
|
|
|
|
## Syntax
|
|
|
|
```js
|
|
math.unaryPlus(x)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Parameter | Type | Description
|
|
--------- | ---- | -----------
|
|
`x` | number | BigNumber | Fraction | string | Complex | Unit | Array | Matrix | Input value
|
|
|
|
### Returns
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Returns the input value when numeric, converts to a number when input is non-numeric.
|
|
|
|
|
|
### Throws
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
|
|
|
|
## Examples
|
|
|
|
```js
|
|
math.unaryPlus(3.5) // returns 3.5
|
|
math.unaryPlus(1) // returns 1
|
|
```
|
|
|
|
|
|
## See also
|
|
|
|
[unaryMinus](unaryMinus.md),
|
|
[add](add.md),
|
|
[subtract](subtract.md)
|