https://github.com/timelessnesses/quake-inverse-squareroot
Quake 3's and math.h implementation port to Python!
https://github.com/timelessnesses/quake-inverse-squareroot
c inverse math python quake root square
Last synced: 3 months ago
JSON representation
Quake 3's and math.h implementation port to Python!
- Host: GitHub
- URL: https://github.com/timelessnesses/quake-inverse-squareroot
- Owner: timelessnesses
- Created: 2023-02-17T16:35:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-13T04:59:55.000Z (almost 2 years ago)
- Last Synced: 2025-10-21T12:52:53.254Z (8 months ago)
- Topics: c, inverse, math, python, quake, root, square
- Language: Python
- Homepage: https://pypi.org/project/quake-inverse-squareroot/
- Size: 471 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# quake 3's fastest inverse square root
This module is a port from Quake 3's inverse square root algorithm.
## Installation
1. Get yourself a C compiler (like gcc, clang or msvc)
2. Run `python setup.py install`
3. Enjoy!
## Build
1. Get yourself a C compiler (like gcc, clang or msvc)
2. Run `python setup.py build bdist_wheel sdist`
3. Check the `dist` folder for the wheel and source distribution
## Documentation
`quake_inverse_sq.coarse_inv_sqrt(number: float) -> float`
This is fastest inverse square root algorithm. It is not as accurate as the `quake_inverse_sq.fined_inv_sqrt` function, but it is much faster. It is implemented from this [wikipedia](https://en.wikipedia.org/wiki/Fast_coarse_inv_sqrt)
`quake_inverse_sq.fined_inv_sqrt(number: float) -> float`
This is the original inverse square root algorithm. It is more accurate than the `quake_inverse_sq.coarse_inv_sqrt` function, but it is slower. It is implemented from `math.h`