るりまサーチ

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

別のキーワード

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

種類

ライブラリ

検索結果

Rational (38066.0)

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

...様に 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
オブ...
...ジェクトは常に既約(それ以上約分できない状態)である
事に注意してください。

//emlist[例][ruby]{
Rational
(2, 6) # => (1/3)
Rational
(1, 3) * 3 # => (1/1)
//}...

NEWS for Ruby 2.6.0 (18.0)

NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...名として追加されました。 14594
* 新規オプション
* Kernel.#Complex, Kernel.#Float, Kernel.#Integer,
Kernel.#Rational にエラー処理方法を指定する :exception オプションが
追加されました。 12732
* Kernel.#system に失敗時に...
...* NilClass
* 新規メソッド
* 互換性のため、NilClass#=~ が追加されました。 15231

* NoMethodError
* 新規オプション
* NoMethodError.new に :receiver オプションが追加されて
Ruby コードからも設定できるようになりま...