lua-users home
lua-l archive

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


Le 14 nov. 2012 à 00:40, Roberto Ierusalimschy <roberto@inf.puc-rio.br> a écrit :

> I have been playing a little with the idea of introducing an integer
> type in Lua. I have intended to present some initial thoughts in the
> workshop.
> 
> The overall idea is quite simple. There will be two kinds of numbers,
> integers and floats. All operations except division result in an
> integer if both operands are integers and in float otherwise. There
> will be two divisions: float division (the usual '/') always have
> a float result, integer division ('//'??) always have an integer
> result.

I love this idea! 
Allowing the explicit manipulation of integers would be a great addition to Lua.

And the good news is that it wouldn't require changes in the C API since lua_pushinteger and lua_tointeger already exist. :)

Jean-Luc