Task

Write a function to detect a   divide by zero error   without checking if the denominator is zero.




/**
 Detect division by zero
*/
 
var ans = 1.0 / 0.0
if $isinfinite(ans) $print("division by zero: ", ans, "\n")
 
ans = 1 / 0
if $isinfinite(ans) $print("division by zero: ", ans, "\n")
 
try $print($idiv(1, 0)) catch problem $print("idiv by zero: ", problem, "\n")