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/029670.html below:

[Python-Dev] Memory size overflows

[Python-Dev] Memory size overflowsTim Peters tim.one@comcast.net
Thu, 17 Oct 2002 18:29:39 -0400
[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