Created
April 28, 2014 20:18
-
-
Save nefftd/11382839 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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