🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #16502

Re: Math calculations

#16502
From: Tor Iver Wilhelmsen
Date: Wed, 17 Feb 1999 00:00
13 lines
883 bytes
"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).
Technical Details
Message-ID: <usoc5whqu.fsf@sds.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7acd6l$6vc20@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,587049a5d7e832c
X-Google-Attributes: gidf74b3,public
From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no>
Subject: Re: Math calculations
Date: 1999/02/17
Message-ID: <usoc5whqu.fsf@sds.no>
X-Deja-AN: 445252571
Sender: towi@SDSA1761
References: <7acd6l$6vc20@forums.borland.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language