Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 22723 invoked from network); 13 Jun 2007 09:22:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2007 09:22:47 -0000 Received: (qmail 35619 invoked by uid 500); 13 Jun 2007 09:22:50 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 35602 invoked by uid 500); 13 Jun 2007 09:22:50 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 35593 invoked by uid 99); 13 Jun 2007 09:22:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2007 02:22:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2007 02:22:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4B2797141AA for ; Wed, 13 Jun 2007 02:22:26 -0700 (PDT) Message-ID: <8442171.1181726546305.JavaMail.jira@brutus> Date: Wed, 13 Jun 2007 02:22:26 -0700 (PDT) From: "Igor V Chebykin (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-2873) [drlvm][jit][opt] frem and drem instructions return incorrect result when divisor is Float/Double MIN_VALUE In-Reply-To: <8494986.1167121941078.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-2873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504174 ] Igor V Chebykin commented on HARMONY-2873: ------------------------------------------ The problem is due to improper algorithm in library functions: double fmod(double,double) float fmodf(float,float) The suggested fix is: 1. replace usage fmodf by fmod 2. replace usage fmod by our own function (classlib already contains those function) > [drlvm][jit][opt] frem and drem instructions return incorrect result when divisor is Float/Double MIN_VALUE > ----------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2873 > URL: https://issues.apache.org/jira/browse/HARMONY-2873 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Linux and Windows > Reporter: Vera Petrashkova > Assignee: Alexey Varlamov > > The following test demonstrates that frem and drem instructions return incorrect result when divisor > is correspondently Float or Double MIN_VALUE. The result equals to dividend. > This issue is reproducible only on Jitrino/OPT. > On interpreter and on Jitrino/JET result is equal to 0.0. > ---------------------test.java--------------- > public class test { > public static void main(String[] args) { > float f1 = 5.5f; > float f2 = Float.MIN_VALUE; > float ff = f1 % f2; > System.out.println( ff == 0.0f ? > "Float test passed. "+f1+" % "+f2+" = "+ff : > "Float test failed. "+f1+" % "+f2+" = "+ff +" instead of 0.0" ); > double d1 = 3.3d; > double d2 = Double.MIN_VALUE; > double dd = d1 % d2; > System.out.println( dd == 0.0d ? > "Double test passed. "+d1+" % "+d2+" = "+dd : > "Double test failed. "+d1+" % "+d2+" = "+dd +" instead of 0.0" ); > } > } > ------------------------ > Output is: > Float test failed. 5.5 % 1.4E-45 = 5.5 instead of 0.0 > Double test failed. 3.3 % 4.9E-324 = 3.3 instead of 0.0 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.