- Value - Value

Value

Number Number

The value to negate.

Returns

Number Number

The negated value.

Negates the number, which is equivalent to multiplying it by -1.

Examples

- Value1
- Value1

Negates Value1 . If it is 4, then -4 is returned.

Value1 * - 1
Value1 * - 1

Negates Value1 . If it is 4, then -4 is returned.

- { 4, - 2 }
- { 4; - 2 }

Returns {  - 4, 2 }{  - 4; 2 }, as each individual array element is effectively multiplied by -1.

- Value - Value

Value

Logical Logical

The value to negate.

Returns

Number Number

The negated value.

Negates the logical value, treating it as a number. (TRUE is interpreted as 1 and FALSE is interpreted as 0.) Negating a number is equivalent to multiplying it by -1.

To convert a logical value, or an array of logical values, to a number or a number array without transforming the values, use the -- operator or the TONUMBER function instead.

Examples

- TRUE
- TRUE

Returns -1, as TRUE is interpreted as 1 and 1 multiplied by -1 is -1.

- FALSE
- FALSE

Returns 0, as FALSE is interpreted as 0 and 0 multiplied by -1 is 0.

- { TRUE, FALSE, TRUE, TRUE }
- { TRUE; FALSE; TRUE; TRUE }

Returns { -1, 0, -1, -1 }, as each individual array element is negated — TRUE is replaced by -1 and FALSE is replaced by 0.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell