Return-Path: Delivered-To: apmail-velocity-dev-archive@www.apache.org Received: (qmail 60694 invoked from network); 6 Feb 2009 16:51:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2009 16:51:36 -0000 Received: (qmail 52581 invoked by uid 500); 6 Feb 2009 16:51:36 -0000 Delivered-To: apmail-velocity-dev-archive@velocity.apache.org Received: (qmail 52569 invoked by uid 500); 6 Feb 2009 16:51:36 -0000 Mailing-List: contact dev-help@velocity.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Velocity Developers List" Delivered-To: mailing list dev@velocity.apache.org Received: (qmail 52558 invoked by uid 99); 6 Feb 2009 16:51:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 08:51:36 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sdh5724@gmail.com designates 209.85.200.168 as permitted sender) Received: from [209.85.200.168] (HELO wf-out-1314.google.com) (209.85.200.168) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 16:51:29 +0000 Received: by wf-out-1314.google.com with SMTP id 25so975828wfa.1 for ; Fri, 06 Feb 2009 08:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=F5Dc3n0J38E4ZuQsEzAtuC9I75u/VXlumySWpEQysqc=; b=WLPtljBWJjna8SNSoKlIVZsv804b5Fn1dnRGowmFsLA7F0FdUJbhAhHZD59HmO8gbO KF3ykTAA8yEfu0wcrYnQeZOruKpPY/TumUwxMkLK3AKVIZBYXnYbN3w6CW6tGakOe8L9 eJQoc29OeRqJ+sdOyIsdtusZ3iy2xbif4fA4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wSmOaGn94KDqldl7Ld6lI4Pd2D/iSBbSTtLAd9S4YbgcOOm3wQO81jTkqDsXawZFfe H5A8ggeANOAug5+RPebaUV+cMeiMt2W5jBRM0ej02Em8nPhI8GZkFWEhdjeP83bMNoCS /m4RzOU6VGPhs55mOb6PcYCj39oVLVNn+dm58= MIME-Version: 1.0 Received: by 10.143.158.16 with SMTP id k16mr1054655wfo.47.1233939069758; Fri, 06 Feb 2009 08:51:09 -0800 (PST) In-Reply-To: References: Date: Sat, 7 Feb 2009 00:51:09 +0800 Message-ID: <53dafd4c0902060851m2568df25n9548c1f0bbd945bb@mail.gmail.com> Subject: Re: Float precison From: Leon sdh5724 To: Velocity Developers List Content-Type: multipart/alternative; boundary=001636e1fba7ed6c40046242d3a0 X-Virus-Checked: Checked by ClamAV on apache.org --001636e1fba7ed6c40046242d3a0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Here $mnt display is right. It is not velocity problem. It is a float problem, you can found it in IEEE float part spec document. You can test you code in JAVA class, "mnt" value alse will display as 1999.9999.... If you use float, you shuold permit float inaccuracy. 2009/2/7 BOUTERFASS Mostapha > Hi all > i put in my context 3 float : v1 = 2 v2 = 11 v3 = 0.1 > > in my template i have > > #set( $mnt = (100 * v1 * v2 / (1 + v3))) > v1 = $v1 > v2 = $v2 > v3 = $v3 > mnt = $mnt > > > after execution i have this result > v1 = 2.0 > v2 = 11.0 > v3 = 0.1 > mnt = 1999.9999999999998 > > > but the right result mast be mnt = 2000 !!! > > > how can i resolve this problem > > > thanx in advence > and sorry for mu english > --001636e1fba7ed6c40046242d3a0--