Negative

Negative

Negative[ expr ] applies the minus sign to an expression.

Usages

Negative[ expr ]

Negative[ expr ] represents -expr. Writing -x in a script gives the same result as Negative[x]. For a positive number, the minus sign is applied directly; otherwise the expression is kept as Negative[ expr ] and displayed with a minus sign.

Example in out
A positive integer. Negative[ 3 ] -3
A positive decimal number. Negative[ 2.5 ] -2.5
An expression is kept as it is. Negative[ Pi ] Negative[Pi]
-x is the same as Negative[x]. -x Negative[x]
A list: each element is negated. Negative[ {1, 2} ] {-1, -2}
Example in rendered
The constant -π. Negative[ Pi ] -π\text{-}\pi
A product with -π. 3 Negative[ Pi ] 3×-π3\times \text{-}\pi
A sum with a negative number is displayed as a subtraction. x + Negative[3] x−3x - 3
Details
  • Double minus: Negative[ -3 ] is not simplified to 3; it stays Negative[-3].
  • Numerical calculates the value: Numerical[ Negative[Pi] ] gives -3.14159265359.

See also: CalcAbs, CalcTimes, Numerical