UNPKG

989 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function unaryPlus
4
5Unary plus operation.
6Boolean values and strings will be converted to a number, numeric values will be returned as is.
7
8For matrices, the function is evaluated element wise.
9
10
11## Syntax
12
13```js
14math.unaryPlus(x)
15```
16
17### Parameters
18
19Parameter | Type | Description
20--------- | ---- | -----------
21`x` | number &#124; BigNumber &#124; Fraction &#124; string &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Input value
22
23### Returns
24
25Type | Description
26---- | -----------
27number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Returns the input value when numeric, converts to a number when input is non-numeric.
28
29
30## Examples
31
32```js
33math.unaryPlus(3.5) // returns 3.5
34math.unaryPlus(1) // returns 1
35```
36
37
38## See also
39
40[unaryMinus](unaryMinus.md),
41[add](add.md),
42[subtract](subtract.md)