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