@@ -71,6 +71,8 @@ quad_to_quad_resolve_descriptors(PyObject *NPY_UNUSED(self),
7171}
7272
7373// Helper function for quad-to-quad same_value check (inter-backend)
74+ // NOTE: the inter-backend uses `double` as intermediate,
75+ // so only values that can be exactly represented in double can pass same_value check
7476static inline int
7577quad_to_quad_same_value_check (const quad_value *in_val, QuadBackendType backend_in,
7678 const quad_value *out_val, QuadBackendType backend_out)
@@ -413,20 +415,6 @@ quad_to_string_adaptive_cstr(Sleef_quad *sleef_val, npy_intp unicode_size_chars)
413415
414416}
415417
416- /*
417- * Same-value check for quad to string conversions.
418- * Works for bytes (S), unicode (U), and StringDType.
419- *
420- * Performs a roundtrip: quad -> string -> quad and verifies the value is preserved.
421- * The check uses the truncated string (up to str_len chars) to ensure the output
422- * buffer can faithfully represent the original value.
423- *
424- * @param in_val The input quad value
425- * @param str_buf The string representation (may be longer than str_len)
426- * @param str_len Length of the string that will actually be stored (excluding null terminator)
427- * @param backend The quad backend type
428- * @return 1 if same_value check passes, -1 if it fails (sets Python error)
429- */
430418static inline int
431419quad_to_string_same_value_check (const quad_value *in_val, const char *str_buf, npy_intp str_len,
432420 QuadBackendType backend)
0 commit comments