Skip to content

Commit e68e6be

Browse files
committed
nolong need pyucs path
1 parent 00acaca commit e68e6be

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

quaddtype/numpy_quaddtype/src/casts.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -380,39 +380,6 @@ quad_to_unicode_resolve_descriptors(PyObject *NPY_UNUSED(self), PyArray_DTypeMet
380380
return static_cast<NPY_CASTING>(NPY_SAME_KIND_CASTING | NPY_SAME_VALUE_CASTING_FLAG);
381381
}
382382

383-
// Helper function: Convert quad to string with adaptive notation
384-
static inline PyObject *
385-
quad_to_string_adaptive(Sleef_quad *sleef_val, npy_intp unicode_size_chars)
386-
{
387-
// Try positional format first to see if it would fit
388-
PyObject *positional_str = Dragon4_Positional_QuadDType(
389-
sleef_val, DigitMode_Unique, CutoffMode_TotalLength, SLEEF_QUAD_DECIMAL_DIG, 0, 1,
390-
TrimMode_LeaveOneZero, 1, 0);
391-
392-
if (positional_str == NULL) {
393-
return NULL;
394-
}
395-
396-
const char *pos_str = PyUnicode_AsUTF8(positional_str);
397-
if (pos_str == NULL) {
398-
Py_DECREF(positional_str);
399-
return NULL;
400-
}
401-
402-
// no need to scan full, only checking if its longer
403-
npy_intp pos_len = strnlen(pos_str, unicode_size_chars + 1);
404-
405-
// If positional format fits, use it; otherwise use scientific notation
406-
if (pos_len <= unicode_size_chars) {
407-
return positional_str; // Keep the positional string
408-
}
409-
Py_DECREF(positional_str);
410-
// Use scientific notation with full precision
411-
return Dragon4_Scientific_QuadDType(sleef_val, DigitMode_Unique,
412-
SLEEF_QUAD_DECIMAL_DIG, 0, 1,
413-
TrimMode_LeaveOneZero, 1, 2);
414-
}
415-
416383
static inline const char *
417384
quad_to_string_adaptive_cstr(Sleef_quad *sleef_val, npy_intp unicode_size_chars)
418385
{

0 commit comments

Comments
 (0)