Best search algorithm to find condition within a range

MRAB python at mrabarnett.plus.com
Tue Apr 7 18:02:20 CEST 2015


On 2015-04-07 16:05, Grant Edwards wrote:
> On 2015-04-07, Chris Angelico <rosuav at gmail.com> wrote:
>> On Wed, Apr 8, 2015 at 12:36 AM,  <jonas.thornvall at gmail.com> wrote:
>>
>>> Integers are internally assumed to be base 10 otherwise you could not
>>> calculate without giving the base.
>>>
>>> All operations on integers addition, subtraction, multiplication and
>>> division assume base 10.
>>
>> You misunderstand how computers and programming languages work. What
>> you're seeing there is that *integer literals* are usually in base
>> 10; and actually, I can point to plenty of assembly languages where
>> the default isn't base 10 (it's usually base 16 (hexadecimal) on IBM
>> PCs, and probably base 8 (octal) on big iron).
>
> I'd be curious to see some of those assemblers. I've used dozens of
> assemblers over the years for everything from microprocessors with a
> few hundred bytes of memory to mini-computers and mainframes.  I've
> never seen one that didn't default to base 10 for integer literals.
>
> I'm not saying they don't exist, just that it would be interesting to
> see an example of one.
>
I have a book called "Choosing and using 4 Bit Microcontrollers" by
Philip McDowell. In it is an example assembly listing for an OKI 6351
microcontroller that uses unadorned hexadecimal literals.



More information about the Python-list mailing list