Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class · Ruby 3.3
ZeroDivisionError
Raised when attempting to divide an integer by 0.
Example
42 / 0 #=> ZeroDivisionError: divided by 0
Note that only division by an exact 0 will raise the exception:
Example
42 / 0.0 #=> Float::INFINITY 42 / -0.0 #=> -Float::INFINITY 0 / 0.0 #=> NaN