csgn
Returns the complex sign used by Nerdamer's branch-sensitive simplification rules.
csgn returns 1 when the real part is positive and -1 when the real part is negative. If the real part is zero, it uses the sign of the imaginary part. Zero returns 0.
When the sign cannot be determined symbolically, Nerdamer keeps csgn(...) unevaluated. The same operation is available directly as nerdamer.csgn(...).
Examples
These examples use Nerdamer Notation.
Use the sign of a positive real part.
csgn(3+2*i)
// → 1Use the sign of a negative real part.
csgn(-3+2*i)
// → -1Keep an unresolved symbolic complex sign.
csgn(x+2*i)Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
csgn(arg1)
nerdamer.csgn
Call the operation through the default nerdamer import.
nerdamer.csgn(x: ExpressionInput): Expression
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | The expression to evaluate the complex sign of |
Returns
Expression — 1, -1, 0, or an unevaluated csgn expression
