lua-users home
lua-l archive

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

>Unfortunately one can't emulate numbers with userdata in Lua. This makes the original poster's example impossible to do with no modifications to Lua core. For whatever reasons (minimalism, simplicity and performance I would think) one can only do math on two values of the same type in Lua and type coercion is not supported.

Not true. Check out my arbitrary precision libraries (lbc and lmapm) at
You can freely mix arbitrary-precision numbers with ordinary Lua numbers
in the same expression.