From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,SPF_PASS, T_DKIM_INVALID shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id A4DE5208CD for ; Wed, 30 Aug 2017 11:21:52 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4A2CC120900; Wed, 30 Aug 2017 20:21:49 +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 EF3651208FF for ; Wed, 30 Aug 2017 20:21:46 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=toqst+7emiEq/E8SeFAvU+iXil0=; b=n7RSgjSfpjXBVWT9Qc 3X0OM0BKjqnuyPPZQgTmutmBQbhCyw902Zks4w44o1R/PI/G/js7WOxL7TK9L/XC /5xj8BtMQm8qTzo6wzoxKLQAX6f9GeOMujENXPLo+y8rT3van3/+0pBl1plC3bCy WEijfQFGtr6EJB7g1EGqiKXx4= Received: by filter0027p3mdw1.sendgrid.net with SMTP id filter0027p3mdw1-32708-59A69FC7-2 2017-08-30 11:21:43.00214301 +0000 UTC Received: from herokuapp.com (ec2-54-92-221-103.compute-1.amazonaws.com [54.92.221.103]) by ismtpd0035p1mdw1.sendgrid.net (SG) with ESMTP id zn245g0wQMGwnVaPnnEaqg for ; Wed, 30 Aug 2017 11:21:42.876 +0000 (UTC) Date: Wed, 30 Aug 2017 11:21:43 +0000 (UTC) From: ded@ddoherty.net To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 57587 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13848 X-Redmine-Issue-Author: ddoherty03 X-Redmine-Sender: ddoherty03 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4//64fQgOVwboMaq+I8kPIa1cQv2bRKb/n3a ya9lcFKGHWdsB8ecuQ9QVinVdulxjEzZ2RwFx7OiQv/BABDlW+tL9Ry/Pq8HMD/SOup4dkwaCXtObH /ejfQVwBYQ0OIQw5KZW1cH5gVjWBwC+lwaQv X-ML-Name: ruby-core X-Mail-Count: 82534 Subject: [ruby-core:82534] [Ruby trunk Bug#13848] BigDecimal.new('200.') raises an exception 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 #13848 has been updated by ddoherty03 (Daniel Doherty). Robert, yes, I think it should be the same as BigDecimal.new('200.'). The problem arises, not when a programmer is typing the number---requiring a programmer to be explicit is OK by me---but when strings are processed that come from a user of the code. ss = '200.' # Read from a user-prepared file. BigDecimal.new(ss) => ArgumentError ... As it is, the programmer has to massage every string to recognize a reasonable, albeit a bit sloppy, string that is clearly meant as a valid number. Regards, ---------------------------------------- Bug #13848: BigDecimal.new('200.') raises an exception https://bugs.ruby-lang.org/issues/13848#change-66343 * Author: ddoherty03 (Daniel Doherty) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- BigDecimal.new('200.') raises an exception: ArgumentError: invalid value for BigDecimal(): "200." It should accept this as a valid decimal number. This requires fixing numbers read in from the wild. -- https://bugs.ruby-lang.org/