Best search algorithm to find condition within a range

Chris Angelico rosuav at gmail.com
Thu Apr 9 13:00:49 EDT 2015


On Fri, Apr 10, 2015 at 2:53 AM, Grant Edwards <invalid at invalid.invalid> wrote:
> On 2015-04-09, Chris Angelico <rosuav at gmail.com> 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?
>
> http://en.wikipedia.org/wiki/Binary_scaling#Binary_angles

Huh, interesting. (Trust the list to have an answer to a rhetorical
question, though to be honest, I should have expected that there'd be
some.) A cursory glance at that Wikipedia page suggests that unsigned
wrap-around can be used just as effectively, though, so I'm not sure
this is at all an argument for standardizing the behaviour of signed
wrap-around.

ChrisA



More information about the Python-list mailing list