Re: [BUG]0/1=?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [BUG]0/1=?
- From: Kristofer Karlsson <kristofer.karlsson@...>
- Date: 2009年1月22日 18:48:28 +0100
On ubuntu, tostring(1/0) gives "inf", and tonumber("inf") gives a number that's indeed the representation for infinite.
So for some systems, you can in fact put back into Lua what you get out (by going through tonumber)
On Thu, Jan 22, 2009 at 5:35 PM, Evan DeMond
<evan.demond@gmail.com> wrote:
On Thu, Jan 22, 2009 at 11:28 AM, Linker
<linker.m.lin@gmail.com> wrote:
Sorry for my mistake.But I found that I cannot assign 1.#INF to a variable.
eg.
> i=1/0
> =i
1.#INF
> j=1.#INF
stdin:1: unexpected symbol near '#'
>
Correct me if I'm wrong on some point here - but 1.#INF isn't Lua syntax. It's just a way of printing the value you get from 1/0. So it only works one way; you can't put it back into Lua because it's not a valid Lua _expression_.
Evan