```python 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](src/csrc/scalar_ops.cpp) ```c 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`.
Activity