Skip to content
instance method

Integer#/

(::BigDecimal) -> ::BigDecimal
(::Integer) -> ::Integer
(::Float) -> ::Float
(::Rational) -> ::Rational
(::Complex) -> ::Complex
self / other → numeric

Returns the quotient of self and other.

For integer other, truncates the result to an integer:

Example
4 / 3              # => 1
4 / -3             # => -2
-4 / 3             # => -2
-4 / -3            # => 1

For non-integer other, returns a non-integer result:

Example
4 / 3.0            # => 1.3333333333333333
4 / Rational(3, 1) # => (4/3)
4 / Complex(3, 0)  # => ((4/3)+0i)
See also #-@ #< #- #<< also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0