slang-users mailing list

[2013 Date Index] [2013 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] integer() returns unexpected values


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]