
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
This package contains implementation of the library "MPComplex". MPComplex is a data type supporting complex numbers which allow comparison and sorting operations.
MPComplex is a data type which support complex numbers which allow comparison and sorting operations. This library extends 'mpc' in 'mpmath' library (https://pypi.org/project/mpmath/) by allowing comparisons and sorting.
The operations supported by MPComplex are addition, subtraction, multiplication, division, power, comparisons, and sorting.
Input: MPComplex(4, 2) + MPComplex(5, 3) Output: MPComplex(9, 5)
Input: MPComplex(7, 9) - MPComplex(3, 3) Output: MPComplex(4, 6)
Input: MPComplex(5, 4) * MPComplex(4, 6) Output: MPComplex(-4, 46)
Input: MPComplex(5, 4) / MPComplex(4, 6) Output: MPComplex(0.846153846153846, -0.269230769230769)
Input: MPComplex(5, 4) // MPComplex(4, 6) Output: MPComplex(0, 0)
Input: MPComplex(4, 2) ** 5 Output: MPComplex(-1216, 1312)
MPComplex objects are compared to each other in the following order:
For example, to check whether MPComplex object a is greater than MPComplex object b or not, the program does the following steps:
The similar process applies to the operations 'less than', 'less than or equal to', and 'greater than or equal to' as well.
For checking equality of two complex numbers, equality applies if the real and imaginary parts of both numbers are equal.
Input: MPComplex(5, 4) > MPComplex(4, 6) Output: True
Input: MPComplex(5, 4) >= MPComplex(4, 6) Output: True
Input: MPComplex(5, 4) < MPComplex(4, 6) Output: False
Input: MPComplex(5, 4) <= MPComplex(4, 6) Output: False
Input: MPComplex(4, 2) == MPComplex(4, 1) Output: False
Input: MPComplex(4, 2) != MPComplex(4, 1) Output: True
If a list of MPComplex objects is called with sort() method, the list will be sorted in ascending order.
Input: [MPComplex(4, 2), MPComplex(4, 1), MPComplex(5, 3), MPComplex(2, 7)].sort() Output: [MPComplex(2, 7), MPComplex(4, 1), MPComplex(4, 2), MPComplex(5, 3)]
FAQs
This package contains implementation of the library "MPComplex". MPComplex is a data type supporting complex numbers which allow comparison and sorting operations.
We found that MPComplex 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.