number_types
Various number types for Python
Usage
Typed complex
Use a complex number with different types for its real and imaginary parts:
>>> from number_types.typed_complex import *
>>> z = DecimalComplex('0.2', '0.1')
>>> z + DecimalComplex('0.1', '0.2')
DecimalComplex(Decimal('0.3'), Decimal('0.3'))
>>> z = complex(0.2, 0.1)
>>> z + complex(0.1, 0.2)
(0.30000000000000004+0.30000000000000004j)
Coordinates
A class representing a (2D) coordinate.
>>> from number_types import Coordinate
>>> Coordinate(0, 1) + Coordinate(1, 0)
>>> Coordinate(1, 1)
>>> Coordinate(-1, 0).to_polar()
Coordinate(1.0, 3.141592653589793, False)
>>> Coordinate(-1, 0).to_polar().equals(Coordinate(-1, 0))
True
>>> Coordinate(3, 4).to_polar()
Coordinate(5.0, 0.9272952180016122, False)
>>> abs(Coordinate(3, 4))
5.0
>>> Coordinate(3, 4).conjugate
Coordinate(3, -4)
Installing
From PyPI
$ pip install number_types
From source
$ git clone 'https://github.com/MitalAshok/number_types.git'
$ python ./number_types/setup.py install
Metadata
Release files for number_types 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| number_types-0.0.5.tar.gz | 4.7 kB | Without provenance | Details for number_types-0.0.5.tar.gz |
Release files / number_types-0.0.5.tar.gz
| Download URL | number_types-0.0.5.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
043333e3c0db0fa59617749f3a502472a687f48144512aa128cce135813a8022
|
|
BLAKE2b-256 checksum How to use checksums |
c073f8fc991ced7de9cfdb26c255a5ff0c3119f08c9561a117e9d5964199e937
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for number_types 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.