検索結果
先頭5件
-
Integer
# rationalize -> Rational (6219) -
自身を Rational に変換します。
...自身を Rational に変換します。
@param eps 許容する誤差
引数 eps は常に無視されます。
例:
2.rationalize # => (2/1)
2.rationalize(100) # => (2/1)
2.rationalize(0.1) # => (2/1)... -
Integer
# rationalize(eps) -> Rational (6219) -
自身を Rational に変換します。
...自身を Rational に変換します。
@param eps 許容する誤差
引数 eps は常に無視されます。
例:
2.rationalize # => (2/1)
2.rationalize(100) # => (2/1)
2.rationalize(0.1) # => (2/1)... -
Integer
# **(other) -> Rational | Float | Integer (132) -
冪(べき)乗を計算します。
...数(Integer)ならば、整数(Integer)を返す。
* otherが負の整数(Integer)ならば、有理数(Rational)を返す。
* otherが有理数(Rational)や浮動小数(Float)ならば、浮動小数(Float)を返す。
例:
2 ** 3 #=> 8
2 ** -3 #=> Rational(1, 8......)
2 ** Rational(3) #=> 8.0
2 ** Rational(1, 2) #=> 1.4142135623731... -
Integer
# to _ r -> Rational (130) -
自身を Rational に変換します。
...自身を Rational に変換します。
例:
1.to_r # => Rational(1, 1)
(1<<64).to_r # => Rational(18446744073709551616, 1)......自身を Rational に変換します。
例:
1.to_r # => (1/1)
(1<<64).to_r # => (18446744073709551616/1)... -
Integer
# / (other) -> Rational | Float | Integer (114) -
商を計算します。
...果は以下のようになります。
* otherが有理数(Rational)ならば、有理数(Rational)を返す。
* otherがそれ以外なら、Integer#/と同じ。つまり、
other が整数(Integer)ならば、整数(Integer)を(整除)、浮動小数(Float)ならば、
浮動小数... -
Integer
# power!(other) -> Integer | Float (7) -
冪(べき)乗を計算します。
...冪(べき)乗を計算します。
@param other 自身を other 乗する数
rationalで再定義される前のInteger#**の別名です。
other が正または 0 の整数 (Integer) ならば、整数 (Integer) を、それ以外
なら、浮動小数 (Float) を返します。...
