Issue #14805 has been updated by duerst (Martin Drst).


Confirmed on trunk.

----------------------------------------
Bug #14805: Enumerator#count is silently limited to int32
https://bugs.ruby-lang.org/issues/14805#change-72333

* Author: amadan (Goran Topic)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin17]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
One takes for granted that integers will be promoted into bigints in Ruby when needed.
Not so with `Enumerator#count`:

    2147483647.times.count
    # => 2147483647 
    2147483648.times.count
    # => -2147483648

(notice the minus!)



-- 
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>