2014-06-08 20:49:52 +02:00

997 B

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

math.unaryplus(x)

Parameters

Parameter Type Description
x Number | BigNumber | Boolean | String | Complex | Unit | Array | Matrix Input value

Returns

Type Description
Number | BigNumber | Complex | Unit | Array | Matrix Returns the input value when numeric, converts to a number when input is non-numeric.

Examples

var math = mathjs();

math.unaryplus(3.5);      // returns 3.5
math.unaryplus(1);     // returns 1

See also

unaryminus, add, subtract