lua-users home
lua-l archive

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


What is wrong with the following code?

  math.nan = 0/0
  math.inf = 1/0
  math.isnan = function (x) return x ~= x end
  math.isnotnan = ...     -- beware: this one may be patented already ;)

Put that in a file `nan.lua' and just say `require "nan"´.

-- Roberto