@@ -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
111114static 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
116122PyMODINIT_FUNC
117123PyInit__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