- Subject: Re: [slang-users] integer() returns unexpected values
- From: Remko van der Vossen <wich@xxxxxxxxx>
- Date: Sun, 17 Feb 2013 13:40:41 +0900
Hello J.B.,
On Sat, Feb 16, 2013 at 10:29:15PM -0600, J.B. Nicholson-Owens wrote:
> I did not expect integer() to do the following:
>
> slsh> integer("023");
> 19
It is pretty common to interpret integers with a leading zero as octal,
which is indeed what happens in this case.
I don't know the exact specs of integer, but I would not be surprised if
it also supports 0x12ab notation for hexadecimal and perhaps also 1010b
for binary.
Regards, Remko
[2013 date index]
[2013 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]