種類
- 文書 (26)
- クラス (11)
- インスタンスメソッド (11)
ライブラリ
- ビルトイン (22)
クラス
- Numeric (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 3
. 0 . 0 (4) - Ruby用語集 (11)
検索結果
-
Numeric
# eql?(other) -> bool (39112.0) -
自身と other のクラスが等しくかつ == メソッドで比較して等しい場合に true を返します。 そうでない場合に false を返します。
...ます。
Numeric のサブクラスは、eql? で比較して等しい数値同士が同じハッシュ値を返すように
hash メソッドを適切に定義する必要があります。
@param other 自身と比較したい数値を指定します。
//emlist[例][ruby]{
p 1.eql?(1) #=>......true
p 1.eql?(1.0) #=> false
p 1 == 1.0 #=> true
//}
@see Object#equal?, Object#eql?, Object#==, Object#===... -
Numeric (38142.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...スです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで......提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce......o o - -
downto | - o - - - - -
eql? | o - - o o - o
even? | - o o......divmod | o o o - -
downto | - o - - -
eql? | o - o - o
even? | - o - - -... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (96.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...r|File::Stat/rdev_major>)) [new]
: ((<File::Stat#rdev_minor|File::Stat/rdev_minor>)) [new]
追加
=== Float
: ((<Numeric#to_int|Numeric/to_int>)) [new]
: ((<Float#to_int|Numeric/to_int>)) [new]
追加。
=== Hash
: ((<Hash#merge|Hash/merge>)) [new]
: ((<Hash#merge!|Hash/merge!>)) [new]......ror/name>)) [new]
追加
=== NilClass
: ((<NilClass#to_f|NilClass/to_f>)) [new]
追加
=== Numeric
: ((<Numeric#div|Numeric/div>)) [new]
: ((<Numeric#quo|Numeric/quo>)) [new]
追加 ((<ruby-dev:19423>))
((<ruby-dev:20962>))
* div - 整除(divmodの第一要......" も取り除きます。
: ((<String#casecmp|String/casecmp>)) [new]
: ((<String#eql?|String/eql?>)) [change]
casecmp 追加。アルファベットの大小を無視した文字列比較。
eql? は、((<$=|組み込み変数>)) の値に関らず常にアルファベットの大... -
Ruby用語集 (36.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...は、N#coerce さえ適切に定義しておけば、Integer 側を変更せずに N という
数値クラスを定義できる。
参照:Numeric#coerce
: CRuby
Ruby の処理系の一つ。C で実装されているのでこの名がある。
Matz により開発が始められた。......らなる配列。
配列式としては % 記法で書くこともできる。
参照:d:spec/literal#percent
: 数値オブジェクト
Numeric クラスのサブクラスのインスタンス。
: スクリプト
: script
いわゆる軽量言語のプログラムをこう呼ぶこと......こでは == による同値性について述べたが、これとは別に、
eql? メソッドによる同値性もある。これはハッシュのキーとして同じと
みなすことを意味する。1.eql?(1.0) は false であり、ハッシュの
キーとして 1 と 1.0 は区別... -
NEWS for Ruby 3
. 0 . 0 (18.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ead`. This change should be compatible for essentially all usages and avoids blocking when using a scheduler. 16792
* Proc
* Proc#== and Proc#eql? are now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQueue
*......pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify Regexp.last_match. 17......low compilations.
* Memory view interface [EXPERIMENTAL]
* The memory view interface is a C-API set to exchange a raw memory area, such as a numeric array or a bitmap image, between extension libraries. The extension libraries can share also the metadata of the memory area that consists of the...