instance method Rational#-
self - other -> Rational | Float
-
差を計算します。
- [PARAM] other:
- 自身から引く数
other に Float を指定した場合は、計算結果を Float で返しま す。
例:
Rational(3, 4) - 1 # => Rational(-1, 4) Rational(3, 4) - 0.5 # => 0.25
class Rational
self - other -> Rational | Float
差を計算します。
other に Float を指定した場合は、計算結果を Float で返しま す。
例:
Rational(3, 4) - 1 # => Rational(-1, 4) Rational(3, 4) - 0.5 # => 0.25