There are two reasons for that error:
Are you using strict?
In reply to Re: illegal division by zero by Caron in thread illegal division by zero by Anonymous Monk