Jump to content

Detect division by zero: Difference between revisions

m
m (→‎{{header|FutureBasic}}: Remove unsupported 'ConsoleWindow')
Line 760:
=={{header|EasyLang}}==
<syntaxhighlight lang="easylang">
procfunc checkDivZero a b . .
result$r = a / b
if result$r = number "-nan" or result$r = number "inf" or result$r = number "-inf"
return 1
print "Found division by zero (" & a & " / " & b & ")"
.
.
callprint checkDivZero 5 7
callprint checkDivZero -1 0
</syntaxhighlight>
{{out}}
<pre>Found division by zero (1 / 0)</pre>
 
=={{header|ECL}}==
2,083

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.