るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.037秒)

別のキーワード

  1. nomethoderror new
  2. _builtin nomethoderror
  3. nomethoderror args
  4. nomethoderror private_call?
  5. match nomethoderror

検索結果

Rational (114205.0)

有理数を扱うクラスです。

有理数を扱うクラスです。

「1/3」のような有理数を扱う事ができます。Integer や Float
と同様に Rational.new ではなく、 Kernel.#Rational を使用して
Rational オブジェクトを作成します。

//emlist[例][ruby]{
Rational(1, 3) # => (1/3)
Rational('1/3') # => (1/3)
Rational('0.33') # => (33/100)
Rational.new(1, 3) # => NoMethodError
//}

Rational オブジェク...