A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-October/029699.html below:

[Python-Dev] Memory size overflows

[Python-Dev] Memory size overflowsTim Peters tim.one@comcast.net
Sat, 19 Oct 2002 23:39:08 -0400
[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