lua-users home
lua-l archive

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


Occasionally discovered while experimenting with syntax parser:

Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> print(0)
0
> print(~0)
-1
> print(-~0)
1
> print(~-~0)
-2
> print(-~-~0)
2
> print(~-~-~0)
-3
> print(-~-~-~0)
3
> print(~-~-~-~0)
-4
> print(-~-~-~-~0)
4

May use "1" too.