On 2015-04-07, Chris Angelico <ros...@gmail.com> wrote: > On Wed, Apr 8, 2015 at 12:36 AM, <jonas.thornv...@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. -- Grant Edwards grant.b.edwards Yow! I'm a fuschia bowling at ball somewhere in Brittany gmail.com -- https://mail.python.org/mailman/listinfo/python-list