RosettaCodeData/Task/Detect-division-by-zero/Maxima/detect-division-by-zero.maxima

8 lines
109 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
f(a, b) := block([q: errcatch(a / b)], if emptyp(q) then 'error else q[1]);
f(5, 6);
5 / 6
f(5, 0;)
'error