Skip to content

Commit 3f0cf90

Browse files
committed
remove unused apis
1 parent e68e6be commit 3f0cf90

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

quaddtype/numpy_quaddtype/src/casts.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
7476
static inline int
7577
quad_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-
*/
430418
static inline int
431419
quad_to_string_same_value_check(const quad_value *in_val, const char *str_buf, npy_intp str_len,
432420
QuadBackendType backend)

quaddtype/tests/test_quaddtype.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5604,6 +5604,7 @@ def test_quad_to_quad_same_value_casting_passing(self, src_backend, dst_backend)
56045604
if val == "nan":
56055605
assert np.isnan(result[0])
56065606
else:
5607+
# compare them as float, as these values anyhow have to under double's range to work
56075608
assert float(result[0]) == float(src[0]), f"Value {val} failed for {src_backend} -> {dst_backend}"
56085609

56095610

0 commit comments

Comments
 (0)