@@ -124,10 +124,6 @@ quad_to_quad_same_value_check(const quad_value *in_val, QuadBackendType backend_
124124 " QuadPrecision value '%s' cannot be represented exactly in target backend" ,
125125 val_str);
126126 }
127- else {
128- PyErr_SetString (PyExc_ValueError,
129- " QuadPrecision value cannot be represented exactly in target backend" );
130- }
131127 return -1 ;
132128}
133129
@@ -465,11 +461,6 @@ quad_to_string_same_value_check(const quad_value *in_val, const char *str_buf, n
465461 " (string width too narrow or precision loss occurred)" ,
466462 val_str);
467463 }
468- else {
469- PyErr_SetString (PyExc_ValueError,
470- " QuadPrecision value cannot be represented exactly in target string dtype "
471- " (string width too narrow or precision loss occurred)" );
472- }
473464 return -1 ;
474465}
475466
@@ -859,14 +850,6 @@ quad_to_stringdtype_strided_loop(PyArrayMethod_Context *context, char *const dat
859850
860851 Py_ssize_t str_size = strnlen (str_buf, QUAD_STR_WIDTH);
861852
862- // Perform same_value check if requested
863- if (same_value_casting) {
864- if (quad_to_string_same_value_check (&in_val, str_buf, str_size, backend) < 0 ) {
865- NpyString_release_allocator (allocator);
866- return -1 ;
867- }
868- }
869-
870853 npy_packed_static_string *out_ps = (npy_packed_static_string *)out_ptr;
871854 if (NpyString_pack (allocator, out_ps, str_buf, (size_t )str_size) < 0 ) {
872855 NpyString_release_allocator (allocator);
@@ -1422,10 +1405,6 @@ static inline int quad_to_numpy_same_value_check(const quad_value *x, QuadBacken
14221405 " QuadPrecision value '%s' cannot be represented exactly in the target dtype" ,
14231406 val_str);
14241407 }
1425- else {
1426- PyErr_SetString (PyExc_ValueError,
1427- " QuadPrecision value cannot be represented exactly in the target dtype" );
1428- }
14291408 return -1 ;
14301409}
14311410
0 commit comments