
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ComplexNumber class to perform complex operations. You can take a look at the source code here.
pip install complex-number
from complex_number import ComplexNumber
import math
z1 = Complex(1, 2) # real, imag
z2 = Complex.from_polar(2, math.pi) # modulus, argument
print(z1)
z2.print(4) # set precision (defaults to 2)
z2.print_polar(4) # set precision (defaults to 2)
print(z1.real)
z1.real = 5
print(z1.imag)
z1.imag = -3
print(z1.modulus)
z1.modulus = 4
print(z1.argument)
z1.argument = math.pi / 2
print(z1 + z2)
z1 += z2
print(z1 - z2)
z1 -= z2
print(z1 * z2)
z1 *= z2
print(z1 / z2)
z1 /= z2
print(z1 ** 3)
z1 **= 3
print(z1.root()) # defaults to 2
print(z1.root(3)) # returns a tuple of ComplexNumbers with all solutions
print(+z1)
print(-z1)
print(z1.conjugate())
print(z1.polar()) # returns dictionary with the keys: modulus and argument.
print(ComplexNumber.to_cartesian(modulus=2, argument=math.pi)) # returns tuple with real and imag part.
print(z1 == z2) # true if real and imag parts are both equal to each other
FAQs
This is a simple complex number python package.
We found that complex-number demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.