On 2026-09-20 04:52:22 +0800, Johann "Myrkraverk" Oskarsson wrote:
> why can't we just do this directly in Python?
Presumably, because in the 35 years of Python history nobody thought
that feature to be useful enough to be added to the language.
hjp
--
_ | Peter J. Holzer|
On 2026-09-19 21:52, Johann "Myrkraverk" Oskarsson wrote:
For instance, here is the utility function in LibTomMath, mp_cnt_lsb(),
chosen because I was looking at the Jacobi Symbol algorithm in Tom St
Denis' book, /BigNum Math/ when I came across this little optimization.
On 9/20/2026 4:39 AM, Stefan Ram wrote:
"Johann \"Myrkraverk\" Oskarsson" wrote or quoted:
it really should be simpler to just
count the zero bits in the underlying C code.
Why can't we do that?
You /can/ ask your chatbot to generate a C extension that
On 9/20/2026 8:25 PM, Stefan Ram wrote:
"Johann \"Myrkraverk\" Oskarsson" wrote or quoted:
_BitScanForward( &index, *digits ) ;
From the documentation:
|If no bit is found, the function returns 0 and the value
|written to the address in the first parameter is undefined.
.
On 9/20/2026 9:48 PM, Stefan Ram wrote:
"Johann \"Myrkraverk\" Oskarsson" wrote or quoted:
Perhaps I should have made that clearer in the code comments?
No, I was too focused on just that one line,
not paying attention to the global context.
A bit more worrying is that I do not off