Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjaminehowe/python-transmaths
A Python module which makes division by zero possible.
https://github.com/benjaminehowe/python-transmaths
mathematics python
Last synced: 2 days ago
JSON representation
A Python module which makes division by zero possible.
- Host: GitHub
- URL: https://github.com/benjaminehowe/python-transmaths
- Owner: BenjaminEHowe
- License: mit
- Created: 2017-11-04T16:53:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T11:40:52.000Z (about 7 years ago)
- Last Synced: 2024-12-06T21:17:24.288Z (27 days ago)
- Topics: mathematics, python
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Transmathematics for Python
A Python module which makes division by zero possible.
## Installation
### From PyPI
`pip3 install transmaths`
### From GitHub
`pip3 install git+https://github.com/BenjaminEHowe/python-transmaths.git`
## Usage
```python
import transmathstransmaths.Transreal(1) # create a transreal number representing 1
transmaths.Transreal(1, 3) # create a transreal number representing one third
transmaths.Transreal(1/3) # create a transreal number representing floating point one third (6004799503160661/18014398509481984)
transmaths.Transreal(64).root(3) # calculate the third root of 64 (exactly 4, not 3.9999999999999996 as `64**(1/3)` would have you believe)
transmaths.Transreal(2).root(2) # calculate the (approximate) square root of 2transmaths.Transcomplex(5+2j) # create a regular complex number as a transcomplex number
transmaths.Transcomplex(5,20) # create a regular complex number as a transcomplex number with polar coordinates
transmaths.Transcomplex(transmaths.INFINITY,20) # create a transcomplex number with a magnitude of infinity
transmaths.Transcomplex(transmaths.NULLITY,0) # the conventional point at nullity, (NULLITY,0)
```