[Python-Dev] Memory size overflows (original) (raw)
Tim Peters tim.one@comcast.net
Thu, 17 Oct 2002 18:29:39 -0400
- Previous message: [Python-Dev] Memory size overflows
- Next message: [Python-Dev] Memory size overflows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[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 , 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.
- Previous message: [Python-Dev] Memory size overflows
- Next message: [Python-Dev] Memory size overflows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]