lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The base-one converter in my code is just a hack that counts the
number of numeric digits following the '#'... as I said, it's not very
useful and it is handled differently than the others...

On 6/17/06, Roger Ivie <rivie@ridgenet.net> wrote:
On Sat, 17 Jun 2006, Joseph Stewart wrote:
> 2#1001 gets converted into 9 and
> 16#ff gets converted to 255
> 1#111 gets converted to 3 (okay, base one isn't that useful)
>
> This would make some of my code much easier to read.

Umm... given that the largest digit in a given radix is one less than
the radix, should that be 1#000 gets converted to 0? 1 wouldn't be a
valid digit in base 1 just as 2 is not a valid digit in base 2.

--
roger ivie
rivie@ridgenet.net