From issues-return-73311-archive-asf-public=cust-asf.ponee.io@commons.apache.org Tue Apr 9 06:15:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id A2A78180763 for ; Tue, 9 Apr 2019 08:15:02 +0200 (CEST) Received: (qmail 62876 invoked by uid 500); 9 Apr 2019 05:55:24 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 62852 invoked by uid 99); 9 Apr 2019 05:55:24 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2019 05:55:24 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 397FFE2A66 for ; Tue, 9 Apr 2019 06:15:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id D295824595 for ; Tue, 9 Apr 2019 06:15:00 +0000 (UTC) Date: Tue, 9 Apr 2019 06:15:00 +0000 (UTC) From: "Costa Theodosiou (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LANG-1445) NumberUtils.createNumber() incorrectly creates BigDecimal when a double type is specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-1445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Costa Theodosiou updated LANG-1445: ----------------------------------- Description: {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() + "D")}} and {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() + "F")}} are incorrectly creating BigDecimals. This is due to a bug: {{if (!(d.isInfinite() || d.floatValue() == 0.0D && !allZeros)) {}} which should be: {{if (!(d.isInfinite() || d.doubleValue() == 0.0D && !allZeros)) {}} A patch has been attached. was: {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() + "D")}} and {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() + "F")}} are incorrectly creating BigDecimals. This is due to a bug: {{ if (!(d.isInfinite() || d.floatValue() == 0.0D && !allZeros)) {}} which should be: {{if (!(d.isInfinite() || d.doubleValue() == 0.0D && !allZeros)) {}} A patch has been attached. > NumberUtils.createNumber() incorrectly creates BigDecimal when a double type is specified > ----------------------------------------------------------------------------------------- > > Key: LANG-1445 > URL: https://issues.apache.org/jira/browse/LANG-1445 > Project: Commons Lang > Issue Type: Bug > Components: lang.math.* > Affects Versions: 3.8.1 > Reporter: Costa Theodosiou > Priority: Major > Attachments: NumberUtils_createNumber()_incorrectly_creates_BigDecimal_when_a_double_type_is_specified.patch > > > {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() + "D")}} > and > {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() + "F")}} > are incorrectly creating BigDecimals. > This is due to a bug: > {{if (!(d.isInfinite() || d.floatValue() == 0.0D && !allZeros)) {}} > which should be: > {{if (!(d.isInfinite() || d.doubleValue() == 0.0D && !allZeros)) {}} > A patch has been attached. -- This message was sent by Atlassian JIRA (v7.6.3#76005)