[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: tostring vs. nan, inf
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 10 Apr 2012 07:58:16 -0300
> 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.