Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -0,0 +1,25 @@
|
|||
number.isInfinite = function
|
||||
return abs(self) == 1/0
|
||||
end function
|
||||
|
||||
number.isNaN = function
|
||||
return self != self
|
||||
end function
|
||||
|
||||
number.toBoolStr = function
|
||||
if self == 0 then return "false"
|
||||
return "true"
|
||||
end function
|
||||
|
||||
checkDivByZero = function(a, b)
|
||||
c = a / b
|
||||
if c.isInfinite or c.isNaN then return true
|
||||
return false
|
||||
end function
|
||||
|
||||
print "Division by zero?"
|
||||
print " 0 / 0 -> " + checkDivByZero( 0, 0).toBoolStr
|
||||
print " 1 / 0 -> " + checkDivByZero( 1, 0).toBoolStr
|
||||
print " 1 / 1 -> " + checkDivByZero( 1, 1).toBoolStr
|
||||
print " -5 / 0 -> " + checkDivByZero(-5, 0).toBoolStr
|
||||
print " -5 / 2 -> " + checkDivByZero(-5, 2).toBoolStr
|
||||
Loading…
Add table
Add a link
Reference in a new issue