[Gerald S. Williams] > Well, I was done tweaking, but then I decided to try out one more > performance tweak. This is in desperate need of commenting, but > it's finally faster than checking via division on my machine: > ... If you've actually got the energy to time these things <wink>, how about adapting the int-mul overflow checking code in Python's intobject.c's int_mul() function too? The CVS (ditto 2.2.2) version + does rely on floating point + doesn't use division + does work for signed integral types + doesn't assume that the number of mantissa bits in a double is enough to hold a full-precision integral product + does assume that the largest integral product is within the dynamic range of a double It could be simplified a little if it were specialized to unsigned mult.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4