I have created this function that correctly displays the infinity symbol when trying to enter 0 into the Y text box. However I still get the division by zero error... here is my code.
here is the case for switch statment
case '/':
$prod = $x / $y;
break;
hh
//check for divide by 0
function check0($y)
{
if ($y == 0)
throw new Exception ($prod = "∞");
return FALSE;
}
try
{
check0($y);
$prod = $x /$y;
}catch(Exception $zero){
echo $zero->getMessage();
}