Sign
The sign of x: -1, 0, or 1 for negative, zero, or positive x.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wikipedia
Sign functionMathWorldSignWikidataQ236813DLMFfront/introduction.common.t2.r18FungrimSign✓Fungrim entryFindStatSt000037via Permutation✓Wolfram LanguageSign!Sign(x)-1, 0, or 1 for negative, zero, or positive real x; for complex z.Typed signatures
| Type | Package | Applies |
|---|---|---|
(complex | permutation | signed_infinity | ~oo) -> complex | number | combinatoricsreplaces analytic | always |
(complex | signed_infinity | ~oo) -> complex | analyticreplaces compute-engine | on Around, CenteredInterval, Interval |
(complex | signed_infinity | ~oo) -> complex | compute-engine | always |
Details
- for , , respectively.
- For a complex number, , the unit complex number pointing toward z. See Abs.
- Recovers the original magnitude: .
- , but propagates as NaN rather than 0.
Definition
Epsil, as the implementation runs it.
on Permutation, over _x
1 if Length(_x) < 2 else (-1) ^ Sum(Map(
Function(Count(Filter(
Range(
i + 1,
Length(_x),
),
Function(_x[i] >
_x[j], j),
)), i),
Range(1, Length(_x)),
))Examples
1 more kept as data, checked against the oraclesScope #
live ↗
InOut
live ↗
InOut
live ↗
InOut
Decides the sign of the exact number by certified bignum evaluation at increasing precision
live ↗InOut
live ↗
InOut
live ↗
InOut
live ↗
InOut
Applications #
Properties #
The third quadrant gives the unit vector at
live ↗InOut
Known value · Wolfram MathematicalFunctionData, Sign
Possible issues #
Sign(ComplexInfinity) is Indeterminate: z/|z| needs a direction, and the undirected infinity has none
live ↗InOut
Known value · Wolfram Sign[ComplexInfinity]
About
| Examples | 43 |
|---|---|
| Checked against | Wolfram Language 38 agree2 differSageMath 36 agree2 differ2 unevaluatedSymPy 35 agree2 differ2 unevaluatedmpmath 35 agreeOscar 22 agreeJulia 33 agree2 errorRust 18 agree |
| Crosswalk | WikipediaMathWorldWikidataDLMFFungrimFungrim entry ×23FindStatWolfram LanguageSageMathSymPympmathOscarJuliaRust |
Implementation
mapped
oscarpackages/oracle/src/mappings.tsmapped
wolframpackages/oracle/src/mappings.tsmapped
sympypackages/oracle/src/mappings.tsmapped
mpmathpackages/oracle/src/mappings.tsmapped
sagepackages/oracle/src/mappings.tsmapped
juliapackages/oracle/src/mappings.tsmapped
rustpackages/oracle/src/mappings.ts