lua-users home
lua-l archive

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


> but I don't see how to detect nan portably.

function isnan(x) return x~=x end
function isinf(x) return (x+1)==x end

See http://lua-users.org/lists/lua-l/2005-02/msg00758.html for alternatives
and my lmathx for a C implementation:
	http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lmathx