You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that pony can't crash, how do we handle integer division by zero? Here are the choices:
Raise an error. This means any use of integer division or modulus must come in a try block or in a partial function.
Force the result to zero. So x / 0 or x % 0 results in 0.
I lean towards option 2. Both have the same performance cost (a conditional on the divisor) since catching SIGFPE (or the equivalent on Windows) would be problematic.
The text was updated successfully, but these errors were encountered:
Given that pony can't crash, how do we handle integer division by zero? Here are the choices:
I lean towards option 2. Both have the same performance cost (a conditional on the divisor) since catching SIGFPE (or the equivalent on Windows) would be problematic.
The text was updated successfully, but these errors were encountered: