3件ヒット
[1-3件を表示]
(0.024秒)
別のキーワード
検索結果
先頭3件
-
Rational
# *(other) -> Rational | Float (117724.0) -
積を計算します。
...。
@param other 自身に掛ける数
other に Float を指定した場合は、計算結果を Float で返しま
す。
//emlist[例][ruby]{
r = Rational(3, 4)
r * 2 # => (3/2)
r * 4 # => (3/1)
r * 0.5 # => 0.375
r * Rational(1, 2) # => (3/8)
//}... -
Rational
# **(other) -> Rational | Float (81670.0) -
冪(べき)乗を計算します。
...す。other が有理数であっても、計算結果が無理数だった場合は Float
を返します。
//emlist[例][ruby]{
r = Rational(3, 4)
r ** Rational(2, 1) # => (9/16)
r ** 2 # => (9/16)
r ** 2.0 # => 0.5625
r ** Rational(1, 2) # => 0.866025403784439
//}... -
Rational
# convert(*arg) -> Rational (63700.0) -
引数を有理数(Rational)に変換した結果を返します。
...引数を有理数(Rational)に変換した結果を返します。
@param arg 変換対象のオブジェクトです。
Kernel.#Rational の本体です。
@see Kernel.#Rational...