Skip to content
instance method

Rational#-

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

Returns the difference of self and other:

Example
Rational(2, 3)  - Rational(2, 3)   #=> (0/1)
Rational(900)   - Rational(1)      #=> (899/1)
Rational(-2, 9) - Rational(-9, 2)  #=> (77/18)
Rational(9, 8)  - 4                #=> (-23/8)
Rational(20, 9) - 9.8              #=> -7.577777777777778
See also #+ #-@ #** #/ also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0