22件ヒット
[1-22件を表示]
(0.018秒)
ライブラリ
- ビルトイン (22)
検索結果
-
Rational
# quo(other) -> Rational | Float (15222.0) -
商を計算します。
...ram other 自身を割る数
other に Float を指定した場合は、計算結果を Float で返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r / 2 # => (3/8)
r / 2.0 # => 0.375
r / 0.5 # => 1.5
r / Rational(1, 2) # => (3/2)
r / 0......# => ZeroDivisionError
//}
@raise ZeroDivisionError other が 0 の時に発生します。
@see Numeric#quo... -
Rational
# / (other) -> Rational | Float (122.0) -
商を計算します。
...ram other 自身を割る数
other に Float を指定した場合は、計算結果を Float で返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r / 2 # => (3/8)
r / 2.0 # => 0.375
r / 0.5 # => 1.5
r / Rational(1, 2) # => (3/2)
r / 0......# => ZeroDivisionError
//}
@raise ZeroDivisionError other が 0 の時に発生します。
@see Numeric#quo...