lua-users home
lua-l archive

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


On Fri, Aug 5, 2011 at 07:45, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> What C99 features would enhance Lua? Some interesting ones, like complex
> numbers and a larger math library are available as external Lua libraries
> at http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/ . I think there is even
> a patch to make lua_Numbers complex.
>

Actually, making lua_Numbers complex is a bad idea. Complex numbers do
not have a natural ordering relationship like real numbers do.
With integers or real numbers you can assert that for any x,y

assert((not (x<y) and not (y<x)) == (x==y))

For complex numbers such an ordering operator does not exist.

--Leo--