Sign¶
- class zixy.container.coeffs.Sign(source: bool | int | Sign | Sign = False)[source]¶
Bases:
RootOfUnityA real sign, i.e. a square root of unity (either +1 or -1).
- __imul__(rhs: int | float | complex | Sign | ComplexSign | Expr) Self[source]¶
Multiply
selfbyrhs.- Raises:
ValueError – If the result of the multiplication cannot be represented by the type of
self.
- __init__(source: bool | int | Sign | Sign = False)[source]¶
Initialize the sign.
- Parameters:
source – Either a boolean or integer interpreted as the exponent \(k\) such that the value of the sign is \((-1)^k\), a Rust-bound
Signinstance, or an existingSigninstance.
- __mul__(other: OtherCoeffT) OtherCoeffT[source]¶
Out-of-place multiplication of
selfbyother.Note
The return type is determined by the type of the right-hand operand
other, with appropriate type promotion rules.
- __rmul__(other: OtherCoeffT) OtherCoeffT[source]¶
Out-of-place multiplication of
otherbyself.See also
- __rtruediv__(other: OtherCoeffT) OtherCoeffT[source]¶
- Overloads:
self, other (float) → float
self, other (complex) → complex
self, other (Sign) → Sign
self, other (ComplexSign) → ComplexSign
self, other (Expr) → Expr
Out-of-place division of
otherbyself.See also
- __truediv__(other: OtherCoeffT) OtherCoeffT[source]¶
- Overloads:
self, other (float) → float
self, other (complex) → complex
self, other (Sign) → Sign
self, other (ComplexSign) → ComplexSign
self, other (Expr) → Expr
Out-of-place division of
selfbyother.See also
- classmethod from_int(value: int | float | complex) Sign[source]¶
Construct an instance of
clsfrom an integer.- Raises:
ValueError – If
valueis not exactly representable ascls.