Support for the Ruby 2.2 series will end March 2018. See here for reference.

In Files

  • numeric.c

Parent

Class/Module Index [+]

Quicksearch
toggle debugging

ZeroDivisionError

Raised when attempting to divide an integer by 0.

42 / 0
#=> ZeroDivisionError: divided by 0

Note that only division by an exact 0 will raise the exception:

42 /  0.0 #=> Float::INFINITY
42 / -0.0 #=> -Float::INFINITY
0  /  0.0 #=> NaN