Closed katestange closed 1 week ago
Thanks for the bug report. I confirm the error (in 10.5.b9 on intel MacOS 14.8.1).
The two commands are not equivalent, because range
returns python integers, whereas floor(log(0,2))
is preparsed to replace 0
with Integer(0)
so it is taking the log of a sage integer, not a python integer. The equivalent command is floor(log(int(0), 2))
which does hang. For a for loop that does not hang (because it uses sage integers), change range
to srange
.
The minimal example seems to be log(int(0), 2)
, which puts sage into an uninterruptible hang.
This is a duplicate of #37794.
Steps To Reproduce
In Sage 10.5.beta6 in Jupyter notebook, or on https://sagecell.sagemath.org/ (as of today), run:
and the kernel appears to hang.
Expected Behavior
By contrast, the supposedly equivalent command
gives an error
ValueError: Calling floor() on infinity or NaN
which is the expected behaviour.Actual Behavior
Kernel appears to hang. Becomes unresponsive, even to user interrupt. Must restart.
Additional Information
No response
Environment
Checklist