int(QuadPrecision('inf')) # = 9223372036854775807 (should raise OverflowError)
int(QuadPrecision('nan')) # = 9223372036854775807 (should raise ValueError)
int(QuadPrecision('1e30')) # = 9223372036854775807 (should return ~1e30)
Root Cause is the following piece of code inside src/csrc/scalar_ops.cpp
return PyLong_FromLongLong(Sleef_cast_to_int64q1(self->value.sleef_value));
We should instead take the quad_to_pylong path, already present for as_integer_ratio and raise on NaN/Inf.
Root Cause is the following piece of code inside src/csrc/scalar_ops.cpp
We should instead take the
quad_to_pylongpath, already present foras_integer_ratioand raise onNaN/Inf.