Skip to content

Commit 61e537c

Browse files
committed
remove debug stmt
1 parent a4f9359 commit 61e537c

1 file changed

Lines changed: 1 addition & 55 deletions

File tree

quaddtype/numpy_quaddtype/src/casts.cpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,61 +1400,7 @@ static inline int quad_to_numpy_same_value_check(const quad_value *x, QuadBacken
14001400
quad_value roundtrip = to_quad<T>(*y, backend);
14011401
if(backend == BACKEND_SLEEF)
14021402
{
1403-
1404-
// debug statements
1405-
union {
1406-
Sleef_quad q;
1407-
struct {
1408-
uint64_t lo;
1409-
uint64_t hi;
1410-
} bits;
1411-
} input_bits, roundtrip_bits, canonical_nan_bits, canonical_neg_nan_bits;
1412-
1413-
input_bits.q = x->sleef_value;
1414-
roundtrip_bits.q = roundtrip.sleef_value;
1415-
canonical_nan_bits.q = QUAD_PRECISION_NAN;
1416-
canonical_neg_nan_bits.q = QUAD_PRECISION_NEG_NAN;
1417-
1418-
int input_signbit = quad_signbit(&x->sleef_value);
1419-
int roundtrip_signbit = quad_signbit(&roundtrip.sleef_value);
1420-
int input_isnan = Sleef_iunordq1(x->sleef_value, x->sleef_value);
1421-
int roundtrip_isnan = Sleef_iunordq1(roundtrip.sleef_value, roundtrip.sleef_value);
1422-
int both_unord = Sleef_iunordq1(x->sleef_value, roundtrip.sleef_value);
1423-
int are_equal = Sleef_icmpeqq1(x->sleef_value, roundtrip.sleef_value);
1424-
bool is_sign_preserved = (input_signbit == roundtrip_signbit);
1425-
1426-
if (input_isnan || roundtrip_isnan) {
1427-
fprintf(stderr, "\n=== DEBUG: NaN detected in same_value_check ===\n");
1428-
fprintf(stderr, "Input bits: hi=0x%016llx lo=0x%016llx\n",
1429-
(unsigned long long)input_bits.bits.hi,
1430-
(unsigned long long)input_bits.bits.lo);
1431-
fprintf(stderr, "Roundtrip bits: hi=0x%016llx lo=0x%016llx\n",
1432-
(unsigned long long)roundtrip_bits.bits.hi,
1433-
(unsigned long long)roundtrip_bits.bits.lo);
1434-
fprintf(stderr, "QUAD_PRECISION_NAN: hi=0x%016llx lo=0x%016llx\n",
1435-
(unsigned long long)canonical_nan_bits.bits.hi,
1436-
(unsigned long long)canonical_nan_bits.bits.lo);
1437-
fprintf(stderr, "QUAD_PREC_NEG_NAN: hi=0x%016llx lo=0x%016llx\n",
1438-
(unsigned long long)canonical_neg_nan_bits.bits.hi,
1439-
(unsigned long long)canonical_neg_nan_bits.bits.lo);
1440-
fprintf(stderr, "input_signbit=%d, roundtrip_signbit=%d\n",
1441-
input_signbit, roundtrip_signbit);
1442-
fprintf(stderr, "input_isnan=%d, roundtrip_isnan=%d\n",
1443-
input_isnan, roundtrip_isnan);
1444-
fprintf(stderr, "both_unord=%d, are_equal=%d, is_sign_preserved=%d\n",
1445-
both_unord, are_equal, is_sign_preserved ? 1 : 0);
1446-
1447-
// Also debug the intermediate value
1448-
fprintf(stderr, "Intermediate value y (as double): %.17g\n", (double)(*y));
1449-
fprintf(stderr, "std::signbit(y): %d\n", std::signbit((double)(*y)));
1450-
fprintf(stderr, "std::isnan(y): %d\n", std::isnan((double)(*y)));
1451-
fprintf(stderr, "=== END DEBUG ===\n\n");
1452-
fflush(stderr);
1453-
}
1454-
1455-
// DONE
1456-
1457-
// bool is_sign_preserved = (quad_signbit(&x->sleef_value) == quad_signbit(&roundtrip.sleef_value));
1403+
bool is_sign_preserved = (quad_signbit(&x->sleef_value) == quad_signbit(&roundtrip.sleef_value));
14581404
// check if input is NaN and roundtrip is NaN with same sign
14591405
if(quad_isnan(&x->sleef_value) && quad_isnan(&roundtrip.sleef_value) && is_sign_preserved)
14601406
return 1;

0 commit comments

Comments
 (0)