[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
SXNzdWUgIzEyMTM0IGhhcyBiZWVuIHVwZGF0ZWQgYnkgTWFydGluIETDvHJzdC4KCgpUc3V5b3No
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74458] [Ruby trunk Feature#12039] Fixnum#infinite?/Bignum#infinite or Numeric#infinte, consistent with Float#infinite? and BigDecimal#infinite?
From:
muraken@...
Date:
2016-03-19 09:49:57 UTC
List:
ruby-core #74458
Issue #12039 has been updated by Kenta Murata. What behavior is desirable for a Complex? ---------------------------------------- Feature #12039: Fixnum#infinite?/Bignum#infinite or Numeric#infinte, consistent with Float#infinite? and BigDecimal#infinite? https://bugs.ruby-lang.org/issues/12039#change-57583 * 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:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>