You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2012/09/23 22:28:07 UTC

[jira] [Updated] (MATH-778) Dfp Dfp.multiply(int x) does not comply with the general contract FieldElement.multiply(int n)

     [ https://issues.apache.org/jira/browse/MATH-778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated MATH-778:
---------------------------------

    Attachment: MATH-778.patch

Hi,

I looked at this issue, and if I understand it correctly, the current multiply(int) method is using a performance shortcut for values of x between 0 and RADIX.

I did a very simple patch to implement the following logic:

 * if 0<=x<RADIX: call multiplyFast with x
 * otherwise create a new Dfp instance with x and call multiply(Dfp) with it
                
> Dfp Dfp.multiply(int x) does not comply with the general contract FieldElement.multiply(int n)
> ----------------------------------------------------------------------------------------------
>
>                 Key: MATH-778
>                 URL: https://issues.apache.org/jira/browse/MATH-778
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>             Fix For: 3.1
>
>         Attachments: MATH-778.patch
>
>
> In class {{org.apache.commons.math3.Dfp}},  the method {{multiply(int n)}} is limited to {{0 <= n <= 9999}}. This is not consistent with the general contract of {{FieldElement.multiply(int n)}}, where there should be no limitation on the values of {{n}}.

--
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