-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from SwayamInSync/dragon4
Updating Quaddtype
- Loading branch information
Showing
31 changed files
with
5,201 additions
and
1,914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Numpy-QuadDType | ||
|
||
## Installation | ||
|
||
``` | ||
pip install numpy==2.1.0 | ||
pip install -i https://test.pypi.org/simple/ quaddtype | ||
``` | ||
|
||
## Usage | ||
|
||
```python | ||
import numpy as np | ||
from numpy_quaddtype import QuadPrecDType, QuadPrecision | ||
|
||
# using sleef backend (default) | ||
np.array([1,2,3], dtype=QuadPrecDType()) | ||
np.array([1,2,3], dtype=QuadPrecDType("sleef")) | ||
|
||
# using longdouble backend | ||
np.array([1,2,3], dtype=QuadPrecDType("longdouble")) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from ._quaddtype_main import ( | ||
QuadPrecision, | ||
QuadPrecDType, | ||
is_longdouble_128, | ||
get_sleef_constant | ||
) | ||
|
||
__all__ = [ | ||
'QuadPrecision', 'QuadPrecDType', 'SleefQuadPrecision', 'LongDoubleQuadPrecision', | ||
'SleefQuadPrecDType', 'LongDoubleQuadPrecDType', 'is_longdouble_128', 'pi', 'e', | ||
'log2e', 'log10e', 'ln2', 'ln10', 'max_value', 'min_value', 'epsilon' | ||
] | ||
|
||
def SleefQuadPrecision(value): | ||
return QuadPrecision(value, backend='sleef') | ||
|
||
def LongDoubleQuadPrecision(value): | ||
return QuadPrecision(value, backend='longdouble') | ||
|
||
def SleefQuadPrecDType(): | ||
return QuadPrecDType(backend='sleef') | ||
|
||
def LongDoubleQuadPrecDType(): | ||
return QuadPrecDType(backend='longdouble') | ||
|
||
pi = get_sleef_constant("pi") | ||
e = get_sleef_constant("e") | ||
log2e = get_sleef_constant("log2e") | ||
log10e = get_sleef_constant("log10e") | ||
ln2 = get_sleef_constant("ln2") | ||
ln10 = get_sleef_constant("ln10") | ||
max_value = get_sleef_constant("quad_max") | ||
min_value = get_sleef_constant("quad_min") | ||
epsilon = get_sleef_constant("epsilon") |
Oops, something went wrong.