るりまサーチ

最速Rubyリファレンスマニュアル検索!
352件ヒット [301-352件を表示] (0.171秒)
トップページ > クエリ:I[x] > クエリ:t[x] > クラス:Rational[x] > クエリ:-[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

ライブラリ

キーワード

検索結果

<< < ... 2 3 4 >>

Rational#hash -> Integer (6301.0)

自身のハッシュ値を返します。

...自身のハッシュ値を返します。

@return ハッシュ値を返します。


@see Object#hash...

Rational#quo(other) -> Rational | Float (6301.0)

商を計算します。

...します。

@param 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#**(rhs) -> Numeric (6201.0)

@todo

...@todo

self のべき乗を返します。 Rational になるようであれば Rational で返します。...

Rational#==(other) -> bool (6201.0)

数値として等しいか判定します。

...param other 自身と比較する数値

@return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[例][ruby]{
Rational
(2, 3) == Rational(2, 3) # => true
Rational
(5) == 5 # => true
Rational
(0)...
...== 0.0 # => true
Rational
('1/3') == 0.33 # => false
Rational
('1/2') == '1/2' # => false
//}...

Rational#coerce(other) -> Array (6201.0)

自身と other が同じクラスになるよう、自身か other を変換し [other, self] という 配列にして返します。

...自身と other が同じクラスになるよう、自身か other を変換し [other, self] という
配列にして返します。

@param other 比較または変換するオブジェクト

//emlist[例][ruby]{
Rational
(1).coerce(2) # => [(2/1), (1/1)]
Rational
(1).coerce(2.2) # => [2.2, 1....

絞り込み条件を変える

Rational#marshal_dump -> Array (6101.0)

Marshal.#load のためのメソッドです。 Rational::compatible#marshal_load で復元可能な配列を返します。

...Marshal.#load のためのメソッドです。
Rational
::compatible#marshal_load で復元可能な配列を返します。

[注意] Rational::compatible は通常の方法では参照する事ができません。...
<< < ... 2 3 4 >>