lua-users home
lua-l archive

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


> As opposed to other numbers, for inf and nan tostring() returns values
> that Lua can not read back:

In Lua 5.1 can convert "inf" and "nan" with tonumber. (But not in Lua 5.2.)

> one can simply define them as global variables

This seems to me to be a good compromise if you want to convert those
values frequently.

> But, maybe, change tostring() so it would return "1/0", "-1/0" and
> "0/0" instead of inf, -inf and nan? 

You can redefine tostring to do that if you need this feature.