Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created April 28, 2014 20:18
Show Gist options
  • Save nefftd/11382839 to your computer and use it in GitHub Desktop.
Save nefftd/11382839 to your computer and use it in GitHub Desktop.
function math.isinf(x)
argcheck(x,1,'number')
return (
x == math.huge and 1 or
x == -math.huge and -1
)
end
function math.isnan(x)
argcheck(x,1,'number')
return x ~= x
end
function math.finite(x)
argcheck(x,1,'number')
return (
x > -math.huge and
x < math.huge
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment