in reply to illegal division by zero

There are two reasons for that error:

Are you using strict?