Numeric literals in other than base 10 - was Annoying octal notation

Mel mwilson at the-wire.com
Sat Aug 22 19:16:39 EDT 2009


James Harris wrote:

> I have no idea why Ada which uses the # also apparently uses it to end
> a number
> 
>   2#1011#, 8#7621#, 16#c26b#

Interesting.  They do it because of this example from 
<http://archive.adaic.com/standards/83rat/html/ratl-02-01.html#2.1>:

2#1#E8                    -- an integer literal of value 256

where the E prefixes a power-of-2 exponent, and can't be taken as a digit of 
the radix.  That is to say

16#1#E2

would also equal 256, since it's 1*16**2 .


	Mel.




More information about the Python-list mailing list