langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,13 @@
|
|||
define('zdiv(x,y)') :(zdiv_end)
|
||||
zdiv &errlimit = 1; setexit(.ztrap)
|
||||
zdiv = x / y :(return)
|
||||
ztrap zdiv = ?(&errtype ? (14 | 262)) 'Division by zero' :s(continue)f(abort)
|
||||
zdiv_end
|
||||
|
||||
* # Test and display
|
||||
output = '1/1 = ' zdiv(1,1) ;* Integers non-zero
|
||||
output = '1.0/1.0 = ' zdiv(1.0,1.0) ;* Reals non-zero
|
||||
output = '1/0 = ' zdiv(1,0) ;* Integers zero
|
||||
output = '1.0/0.0 = ' zdiv(1.0,0.0) ;* Reals zero
|
||||
output = 'Zero checks complete'
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue