<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:14pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;"><span>Valentin's very perceptive comment aside, you could use one of the two error handling mechanisms as in:</span></div><div style="background-color: transparent;"><span><font face="arial, helvetica, sans-serif"><div style="font-size: 19px; background-color: transparent;"><br></div><div style="font-size: 19px; background-color: transparent; color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-style: normal;">case catch A/N of</div><div style="font-size: 19px; background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">    </span>{'EXIT', {badarith,_}} -></div><div style="font-size: 19px; background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">       </span>    io:format("Some error statement or
 whatever!~n",[]);</div><div style="font-size: 19px; background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre"> </span>Normal -> Normal</div><div style="font-size: 19px; background-color: transparent;">    end.</div><div style="font-size: 19px; background-color: transparent;"><br></div><div style="font-size: 19px; background-color: transparent; color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-style: normal;">or</div><div style="font-size: 19px; background-color: transparent; color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-style: normal;"><br></div><div style="background-color: transparent;"><div style="background-color: transparent;"><span style="font-size: 19px;">try A/N </span></div><div style="background-color: transparent;"><span style="font-size: 19px;">    catch</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span
 class="Apple-tab-span" style="white-space:pre"> </span>error:badarith -></span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre">    </span>    io:format("some statement or whatever ~p/~p~n",[A,N]);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre">  </span>Normal -> Normal</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">    end.</span></div></div></font></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 19px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">I'm not positive, but it seems like you might not be aware of these error handling mechanisms </div><div style="font-family:
 arial, helvetica, sans-serif; font-size: 19px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Valentin Micic <valentin@pixie.co.za><br> <b><span style="font-weight: bold;">To:</span></b> Lucky Khoza <mrkhoza@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> erlang-questions@erlang.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, November 15, 2012 8:47 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [erlang-questions] Division by Zero<br> </font> </div> <br>Did you consider not dividing  by zero?<br><br>V/<br><br>On 15 Nov 2012, at 3:42 PM, Lucky Khoza wrote:<br><br>> Hi
 Erlang Developers,<br>> <br>> How do i resolve division by zero errors in Erlang.<br>> <br>> Kindest Regards<br>> Lucky<br>> _______________________________________________<br>> erlang-questions mailing list<br>> <a ymailto="mailto:erlang-questions@erlang.org" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br>_______________________________________________<br>erlang-questions mailing list<br><a ymailto="mailto:erlang-questions@erlang.org" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br><br> </div> </div>  </div></body></html>