Family Day update

This commit is contained in:
Ingy döt Net 2020-02-17 23:21:07 -08:00
parent aac6731f2c
commit 9ad63ea473
2442 changed files with 39761 additions and 8255 deletions

View file

@ -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

View file

@ -0,0 +1,2 @@
div(A, B, C, Ex) :-
catch((C is A/B), Ex, (C = infinity)).

View file

@ -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