Skip to content

Commit d46a8f7

Browse files
committed
edit extension
1 parent f11b08b commit d46a8f7

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/workflows/build_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
126126
- name: Build wheels
127127
env:
128-
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
128+
CIBW_BUILD: "cp314-* cp313t-* cp314t-*"
129129
CIBW_ENABLE: cpython-prerelease cpython-freethreading
130130
CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
131131
CIBW_BUILD_VERBOSITY: "3"

quaddtype/numpy_quaddtype/src/quaddtype_main.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,17 @@ get_sleef_constant(PyObject *self, PyObject *args)
8080
else if (strcmp(constant_name, "precision") == 0) {
8181
Py_DECREF(result);
8282
// precision = int(-log10(epsilon))
83-
int64_t precision = Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
83+
int64_t precision =
84+
Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
8485
return PyLong_FromLong(precision);
8586
}
8687
else if (strcmp(constant_name, "resolution") == 0) {
8788
// precision = int(-log10(epsilon))
88-
int64_t precision = Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
89+
int64_t precision =
90+
Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
8991
// resolution = 10 ** (-precision)
90-
result->value.sleef_value = Sleef_powq1_u10(Sleef_cast_from_int64q1(10), Sleef_cast_from_int64q1(-precision));
92+
result->value.sleef_value =
93+
Sleef_powq1_u10(Sleef_cast_from_int64q1(10), Sleef_cast_from_int64q1(-precision));
9194
}
9295
else {
9396
PyErr_SetString(PyExc_ValueError, "Unknown constant name");
@@ -109,9 +112,12 @@ static PyMethodDef module_methods[] = {
109112
{NULL, NULL, 0, NULL}};
110113

111114
static struct PyModuleDef moduledef = {
112-
PyModuleDef_HEAD_INIT, .m_name = "_quaddtype_main",
115+
PyModuleDef_HEAD_INIT,
116+
.m_name = "_quaddtype_main",
113117
.m_doc = "Quad (128-bit) floating point Data Type for NumPy with multiple backends",
114-
.m_size = -1, .m_methods = module_methods};
118+
.m_size = -1,
119+
.m_methods = module_methods,
120+
};
115121

116122
PyMODINIT_FUNC
117123
PyInit__quaddtype_main(void)
@@ -123,6 +129,10 @@ PyInit__quaddtype_main(void)
123129
return NULL;
124130
}
125131

132+
#ifdef Py_GIL_DISABLED
133+
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
134+
#endif
135+
126136
if (init_quadprecision_scalar() < 0)
127137
goto error;
128138

0 commit comments

Comments
 (0)