Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 577031061E for ; Sat, 31 Aug 2013 19:48:52 +0000 (UTC) Received: (qmail 52816 invoked by uid 500); 31 Aug 2013 19:48:51 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 52633 invoked by uid 500); 31 Aug 2013 19:48:51 -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 52616 invoked by uid 99); 31 Aug 2013 19:48:51 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Aug 2013 19:48:51 +0000 Date: Sat, 31 Aug 2013 19:48:51 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (MATH-1029) Creating BigFraction objects is not consistent for negative/positive values MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Thomas Neidhart created MATH-1029: ------------------------------------- Summary: Creating BigFraction objects is not consistent for negative/positive values Key: MATH-1029 URL: https://issues.apache.org/jira/browse/MATH-1029 Project: Commons Math Issue Type: Bug Reporter: Thomas Neidhart Creating a BigFraction object for large integer values will return different results whether the argument is positive or negative: {noformat} BigFraction f1 = new BigFraction(-1e10, 1000); -> will return a fraction with a numerator of -1e10 and denominator of 1 BigFraction f2 = new BigFraction(1e10, 1000); -> will throw a FractionConversionException {noformat} the problem is in the check for overflow, it is not done on the absolute value of the argument, also it should be done only after the check if the argument is actually an integer. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira