Best search algorithm to find condition within a range
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Thu Apr 9 13:41:21 EDT 2015
On Fri, 10 Apr 2015 02:43 am, Chris Angelico wrote:
> For application work, it's usually much better to have an integer type
> like Python's or Pike's int - a signed integer that can never
> overflow. For low-level bit manipulation work, you usually want an
> unsigned integer of specific size, with well defined wrap-around
> behaviour. When do you actually want a signed integer with
> well-defined overflow behaviour?
I'm lead to believe that such a thing is useful in crypto, although I don't
quite see it myself.
There are good ways to deal with out-of-range results in systems languages:
- well-defined wrap-around behaviour;
- saturation;
- trapping.
"Do whatever the hell the compiler feels like doing" is not one of them.
More discussion here:
http://blog.regehr.org/archives/642
--
Steven
More information about the Python-list
mailing list