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 4555D9E8C for ; Mon, 27 Feb 2012 04:42:16 +0000 (UTC) Received: (qmail 23468 invoked by uid 500); 27 Feb 2012 04:42:15 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 23386 invoked by uid 500); 27 Feb 2012 04:42:13 -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 23292 invoked by uid 99); 27 Feb 2012 04:42:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 04:42:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 04:42:08 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id BB3CD33CFBA for ; Mon, 27 Feb 2012 04:41:48 +0000 (UTC) Date: Mon, 27 Feb 2012 04:41:48 +0000 (UTC) From: =?utf-8?Q?S=C3=A9bastien_Brisard_=28Commented=29_=28JIRA=29?= To: issues@commons.apache.org Message-ID: <1802928087.22131.1330317708768.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1186766933.21211.1330279008964.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-755) On the contract of FieldElement.divide(T) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-755?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D132170= 30#comment-13217030 ]=20 S=C3=A9bastien Brisard commented on MATH-755: ---------------------------------------- As of {{r1294027}}, {{BigFraction.divide()}} throws {{MathArithmeticExcepti= on}}. =20 > On the contract of FieldElement.divide(T) > -------------------------------------------- > > Key: MATH-755 > URL: https://issues.apache.org/jira/browse/MATH-755 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0, 3.1 > Reporter: S=C3=A9bastien Brisard > Assignee: S=C3=A9bastien Brisard > Priority: Minor > Labels: exception, field > Fix For: 3.1 > > > As discussed on the mailing list: > {quote} > The contract of {{FieldElement.divide(T)}} states that an {{Arithmetic= Exception}} should be thrown if the parameter is zero. However, for this bo= undary case > * {{BigFraction}} throws {{ZeroException}} > * {{ArithmeticException}} throws {{ArithmeticException}} > * {{Complex}} uses NaNs instead of exceptions > * {{Dfp}}, {{DfpDec}} use flags instead of exceptions > * {{Fraction}} throws {{MathArithmeticException}}. > {quote} > There is a need for some cleaning up, which will proceed in two steps > # in version 3.0 of the {{FieldElement}} interface the statement that an = exception must be thrown will be removed. The rationale for this is that so= metimes, an exception is actually not wanted. For example, I'm using a wrap= per around primitive {{double}}, and I want all boundary cases to be handle= d _exactly_ the same way as the primitive operation "/"). > # in version 3.1 of Commons Math, the _same_ exception (if any) will be t= hrown by all implementations. This will require to chose between {{Arithmet= icException}}, {{MathArithmeticException}} and {{ZeroException}}. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira