Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
|
|
@ -1,5 +1,4 @@
|
|||
function div(a,b)
|
||||
quot = a/b
|
||||
if quot == 1/0 then error() end
|
||||
return quot
|
||||
local function div(a,b)
|
||||
if b == 0 then error() end
|
||||
return a/b
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
div(A, B, C, Ex) :-
|
||||
catch((C is A/B), Ex, (C = infinity)).
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
Module DivByZeroDetection
|
||||
|
||||
Sub Main()
|
||||
Console.WriteLine(safeDivision(10, 0))
|
||||
End Sub
|
||||
|
||||
Private Function safeDivision(v1 As Integer, v2 As Integer) As Boolean
|
||||
Try
|
||||
Dim answer = v1 / v2
|
||||
Return False
|
||||
Catch ex As Exception
|
||||
Return True
|
||||
End Try
|
||||
End Function
|
||||
End Module
|
||||
Loading…
Add table
Add a link
Reference in a new issue