Task

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




d = 5/0;
if ( isinf(d) )
  if ( index(lastwarn(), "division by zero") > 0 )
     error("division by zero")
  endif
endif