< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #12039 has been updated by Samuel Williams.
This looks good, do you think we can integrate this at some point? What do we need to do?
----------------------------------------
Feature #12039: Fixnum#infinite?/Bignum#infinite or Numeric#infinte, consistent with Float#infinite? and BigDecimal#infinite?
https://bugs.ruby-lang.org/issues/12039#change-59025
* Author: Samuel Williams
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
We have an issue where it is not easy to ask if a number is +ve or -ve infinity. https://github.com/rails/arel/issues/411
Both Float and BigDecimal do respond to infinite? but Integer derivatives don't. It sort of makes sense, since we don't have an infinity value for Fixnum/Bignum. However, it makes polymorphic code hard.
```
[13] pry(main)> Float::INFINITY.infinite?
=> 1
[14] pry(main)> -Float::INFINITY.infinite?
=> -1
[15] pry(main)> BigDecimal::INFINITY.infinite?
=> 1
[16] pry(main)> -BigDecimal::INFINITY.infinite?
=> -1
```
Given a Numeric value x, it would be nice to query if it is INFINITY or not. Propose adding a default implementation to Numeric, which always returns false or nil.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>