[erlang-questions] Division by Zero
Thu Nov 15 15:03:43 CET 2012
On Thu, Nov 15, 2012 at 03:42:42PM +0200, Lucky Khoza wrote:
> How do i resolve division by zero errors in Erlang.
You can catch errors like this with the try/catch construct, documented
An example for your specific case:
1> try 1 / 0 catch error:badarith -> io:format("Impossible!~n") end.
Note above that division by zero results in a 'badarith' error, for "bad
You ought to refer to tutorials and the manual for basic things like these.
More information about the erlang-questions