Message412192
> todecstr treats it as an "input" conversion instead, ...
Worth pointing this out since it doesn't seem widely known: "input" base conversions are _generally_ faster than "output" ones. Working in the destination base (or a power of it) is generally simpler.
In the math.factorial(1000000) example, it takes CPython more than 3x longer for str() to convert it to base 10 than for int() to reconstruct the bigint from that string. Not an O() thing (they're both quadratic time in CPython today). |
|
Date |
User |
Action |
Args |
2022-01-31 06:11:48 | tim.peters | set | recipients:
+ tim.peters, Carl.Friedrich.Bolz, Dennis Sweeney |
2022-01-31 06:11:48 | tim.peters | set | messageid: <1643609508.12.0.187844878718.issue46558@roundup.psfhosted.org> |
2022-01-31 06:11:48 | tim.peters | link | issue46558 messages |
2022-01-31 06:11:48 | tim.peters | create | |
|