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

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to