Article View: borland.public.jbuilder.java.language
Article #16511Re: Math calculations
From: flashback
Date: Thu, 18 Feb 1999 00:00
Date: Thu, 18 Feb 1999 00:00
32 lines
1389 bytes
1389 bytes
Tor Iver Wilhelmsen schrieb: > > "Kerry Helmer" <khelmer@parlorcity.com> writes: > > >This returns 0.9899999999999949 instead of .99 Can someone help explain to > >me what I'm doing wrong? > > You're not, but the IEEE floating point standard has problems > expressing some numbers. > > > Does anybody have some rules to follow that would help me when performing > > math operations? > > Use integers for currency. (that is, represent e.g. $1.69 with the > number 169). > another possibility is to use objects of the class java.math.BigDecimal regards gregor -- the best is yet to come... http://www.netcologne.de/~nc-schneigr icq-# 14100227 public key available at pgp.ai.mit.edu
Technical Details
Message-ID:
<36CBB2D3.4EEE0E21@netcologne.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7acd6l$6vc20@forums.borland.com> <usoc5whqu.fsf@sds.no>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,587049a5d7e832c X-Google-Attributes: gidf74b3,public From: flashback <flashback@netcologne.de> Subject: Re: Math calculations Date: 1999/02/18 Message-ID: <36CBB2D3.4EEE0E21@netcologne.de> X-Deja-AN: 445604553 Content-Transfer-Encoding: 7bit References: <7acd6l$6vc20@forums.borland.com> <usoc5whqu.fsf@sds.no> To: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no> X-Accept-Language: en,de Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: flashback@netcologne.de Newsgroups: borland.public.jbuilder.java.language