How to resolve the algorithm Detect division by zero step by step in the Erlang programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Detect division by zero step by step in the Erlang programming language
Table of Contents
Problem Statement
Write a function to detect a divide by zero error without checking if the denominator is zero.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Detect division by zero step by step in the Erlang programming language
Source code in the erlang programming language
div_check(X,Y) ->
case catch X/Y of
{'EXIT',_} -> true;
_ -> false
end.
You may also check:How to resolve the algorithm Roman numerals/Encode step by step in the OpenEdge/Progress programming language
You may also check:How to resolve the algorithm Date format step by step in the min programming language
You may also check:How to resolve the algorithm Password generator step by step in the Phix programming language
You may also check:How to resolve the algorithm Filter step by step in the REXX programming language
You may also check:How to resolve the algorithm Test integerness step by step in the Tcl programming language