Skip to content

Negate ​

The additive inverse of x: −x-x.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaAdditive inverseMathWorldAdditiveInverseWikidataQ715358Wolfram LanguageMinus✓
Negate(x)the additive inverse −x-x.
Typed signatures
TypePackageApplies
(complex | infinity) -> numberadelesreplaces numeralson Adele, ProfiniteNumber
(complex | infinity) -> numberanalyticreplaces compute-engineon Around, CenteredInterval, Interval
(complex | infinity) -> numbercompute-enginealways
(complex | infinity) -> numberhypercomplexreplaces analyticfor symbols ^(?:i|j|epsilon|e|f|theta|epsilonSymbol|varepsilon|thetaSymbol|vartheta)_\d+$
(complex | infinity) -> numbernumeralsreplaces hypercomplexon AdicNumeral
(complex | infinity) -> numberresiduesreplaces hypercomplexon IntegerMod

Domain: Arithmetic

Details
  • The additive inverse: Negate⁡(x)=−x\operatorname{Negate}(x) = -x.
  • Double negation cancels: −(−x)=x-(-x) = x.
  • Distributes over a sum: −(a+b)=−a−b-(a+b) = -a - b.
  • Threads element-wise over a list.
  • compute-engine keeps Negate as its own head rather than rewriting to Multiply(−1,x)\mathrm{Multiply}(-1, x).

Plot

ComplexPlot
real slice

Examples

Basic #
live ↗
In−5-5Out−5-5
live ↗
In55Out55

Its own negation

live ↗
In00Out00
live ↗
In−34-\frac{3}{4}Out−34-\frac{3}{4}

Threads element-wise over a list

live ↗
In−[1,−2,3]-\bigl\lbrack1, -2, 3\bigr\rbrackOut[−1,2,−3]\bigl\lbrack-1, 2, -3\bigr\rbrack

Stays symbolic

live ↗
In−x-xOut−x-x
Scope #
live ↗
In−(1+2i)-(1+2i)Out−1−2i-1-2i

Threads over a matrix, entry by entry

live ↗
In−[[1,−2],[3,4]]-\bigl\lbrack\bigl\lbrack1, -2\bigr\rbrack, \bigl\lbrack3, 4\bigr\rbrack\bigr\rbrackOut[[−1,2],[−3,−4]]\bigl\lbrack\bigl\lbrack-1, 2\bigr\rbrack, \bigl\lbrack-3, -4\bigr\rbrack\bigr\rbrack

Folds into a numeric coefficient

live ↗
In−(2x)-(2x)Out−2x-2x
Applications #

Recording a $42.50 charge as a negative balance adjustment

live ↗
In−42.5-42.5Out−42.5-42.5
Properties #

Double negation cancels: −(−x)=x-(-x) = x

live ↗
In−−x--xOutxx

Distributes over a sum: −(a+b)=−a−b-(a+b) = -a - b

live ↗
In−(a+b)=−a−b-(a+b)=-a-bOutTrue\mathrm{True}

−(a−b)=b−a-(a-b) = b-a

live ↗
In−(a−b)-(a-b)Outb−ab-a

The additive inverse: x+(−x)=0x + (-x) = 0

live ↗
Inx−xx-xOut00
Possible issues #

Flips signed infinities too

live ↗
In−∞-∞Out−∞-∞
About
Examples15
Checked againstWolfram Language 15 agreeSageMath 15 agreeSymPy 15 agreempmath 8 agreemathlib4 6 agree1 errorOscar 8 agreeJulia 9 agreeRust 7 agree
CrosswalkWikipediaMathWorldWikidataWolfram Language

Implementation

mappedsympypackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts
mappedsagepackages/oracle/src/mappings.ts
mappedoscarpackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts
mappedmathlib4packages/oracle/src/mappings.ts
mappedrustpackages/oracle/src/mappings.ts

See also: Abs, Sign