[Tim\ >> 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? [Gerald S. Williams] > I'll take a look. Thanks! >> It could be simplified a little if it were specialized to unsigned >> mult. > You're simply referring to breaking down the operation into "remove > sign", multiply, and "generate sign" stages, right? I'll definitely > keep it in mind. Goodness no -- that kind of cleverness is usually buggy, and usually by failing to account for that the moral equivalent of -sys.maxint-1 is a fine product, but sys.maxint+1 isn't. I was talking specifically about the based-on-doubles int_mul(). In particular, the slow-path line const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod; isn't needed if we know the product is >= 0.
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