Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Exceptions/Jq/exceptions-1.jq
Normal file
1
Task/Exceptions/Jq/exceptions-1.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
try FILTER catch CATCHER
|
||||
14
Task/Exceptions/Jq/exceptions-2.jq
Normal file
14
Task/Exceptions/Jq/exceptions-2.jq
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
def division(a;b):
|
||||
def abs: if . < 0 then -. else . end;
|
||||
if a == 0 and b == 0 then error("0/0")
|
||||
elif b == 0 then error("division by 0")
|
||||
elif (a|abs|log) - (b|abs|log) > 700 then error("OOB")
|
||||
else a/b
|
||||
end;
|
||||
|
||||
def test(a;b):
|
||||
try division(a;b)
|
||||
catch if . == "0/0" then 0
|
||||
elif . == "division by 0" then null
|
||||
else "\(.): \(a) / \(b)"
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue