Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wdym Lua has no floats? Lua defaults to doubles (big floats) not integers.


What I said is that Lua doesn't need floats.

You can build Lua on a 32 bit chip which doesn't have a native float type, without floating point support. Which is handy.


As of Lua 5.3 (from 2015), Lua has both doubles and integers. The famous book "Programming in Lua", still often used and quoted, did apply to 5.2, which had only doubles.


Worth adding that the only 5.1 anyone still uses (not you Warcraft), LuaJIT, has native support for C numeric types, including complex numbers. They can be referenced literally as 12LL, you can do arithmetic on them, but have to call `tonumber` to use them where Lua expects a 'number'.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: