From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id E93FA1F453 for ; Wed, 30 Jan 2019 06:20:20 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7F301121947; Wed, 30 Jan 2019 15:20:18 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id A78C6121943 for ; Wed, 30 Jan 2019 15:20:15 +0900 (JST) Received: by filter0046p3las1.sendgrid.net with SMTP id filter0046p3las1-16816-5C51421D-32 2019-01-30 06:20:13.593659275 +0000 UTC m=+119114.274204228 Received: from herokuapp.com (ec2-3-80-166-37.compute-1.amazonaws.com [3.80.166.37]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id 4oq_4izVSUqzg7Wj0ENMHg for ; Wed, 30 Jan 2019 06:20:13.595 +0000 (UTC) Date: Wed, 30 Jan 2019 06:20:14 +0000 (UTC) From: naruse@airemix.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66783 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15518 X-Redmine-Issue-Author: sakuro X-Redmine-Issue-Assignee: mrkn X-Redmine-Sender: naruse X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7AYoVxlr5SV+0PDszE5kQanuLaFXsgdq/LyH LLTc8QKLzHqledL6XmRf7lJBlmnGeD+E7tn5DKIVW5y7d/AtggFveX3xVMO5gYcXjQt9h77st0Bs4n 6rOAHYdtvlbx8nAmlOrw5OsQaMDG+1Pr2QCv7W3Gfk1kCHLQrBduMPHW1w== X-ML-Name: ruby-core X-Mail-Count: 91331 Subject: [ruby-core:91331] [Ruby trunk Bug#15518] good old Infinite range notation behavior X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15518 has been updated by naruse (Yui NARUSE). Backport changed from 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE ruby_2_6 r66949 merged revision(s) 66947. ---------------------------------------- Bug #15518: good old Infinite range notation behavior https://bugs.ruby-lang.org/issues/15518#change-76582 * Author: sakuro (Sakuro OZAWA) * Status: Closed * Priority: Normal * Assignee: mrkn (Kenta Murata) * Target version: * ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18] * Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE ---------------------------------------- Ruby 2.5.3's behavior ~~~ # without step, it produces integer sequence (1..Float::INFINITY).first(10) #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # with step, it produces floats instead of integers (1..Float::INFINITY).step(1).first(10) #=> [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] ~~~ Ruby 2.6.0's behavior ~~~ # endless range (1..).first(10) #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # with step, all numbers are integer now (1..).step(1).first(10) #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # old idiom with Float::INFINITY (1..Float::INFINITY).first(10) #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (1..Float::INFINITY).step(1).first(10) #=> FloatDomainError (Infinity) ~~~ Which are intended change and which are not? -- https://bugs.ruby-lang.org/