lua-users home
lua-l archive

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

It was thus said that the Great Andrew Starks once stated:
> >
> type(n1) ~= "string" and tostring(n1) == "-nan"
> ? Is it type number? If so, it's the only number not equal to itself, so
> you've got that going for it.

  "nan" seems to behave in an implementation dependent manner:

> n1=0/0
> n2=0/0
> print (n1, n2, n1==n2, n1==n1)
nan     nan     false   false