Hi Steve,

It's a problem inherent to floating point computations. U may use the 
double datatype to increase precision. If you need arbitrary precision 
computations, u should use the Java Ultimate Math Package, written by 
the Utrecht University, Netherlands. It is available @:

   http://members.xoom.com/znerd/java/jump/

It's distributed under the GNU General Public Library License (hooray). 
Source code, whitepaper, javadocs etc. all available.

Meself happens to be the guy who wrote it. Let me know if you use and 
whether you like it. :-)

Ernst


----Original Message Follows----
>From [EMAIL PROTECTED] Thu Sep  3 22:58:04 1998
Received: (from listadm@localhost) by shell.ncm.com (8.8.5/8.7.5) id 
CAA02701; Fri, 4 Sep 1998 02:07:28 -0400
Resent-Date: Fri, 4 Sep 1998 02:07:28 -0400
Message-Id: <>
X-Sender: [EMAIL PROTECTED]
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0
Date: Fri, 04 Sep 1998 00:51:59 +1000
To: [EMAIL PROTECTED]
From: Steve Curry <[EMAIL PROTECTED]>
Subject: Java 1.1.6 can't add!
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Resent-Message-ID: <"FvtSt1.0.0g.OEuxr"@shell>
Resent-From: [EMAIL PROTECTED]
X-Mailing-List: <[EMAIL PROTECTED]> archive/latest/1880
X-Loop: [EMAIL PROTECTED]
Precedence: list
Resent-Sender: [EMAIL PROTECTED]

I have installed JDK 1.1.6 on my RedHat 5.0 Linux box and when 
performing
mathmatical calculations in java I get incorrect results. Take for 
example
(float)14.39 I can do a basic System.out.println and it will print out 
on
the command line: 14.3899999999999. What is wrong with my JDK 1.1.6? I 
am
new to Java so hopefully I'm just missing something small here. 


Steve






+---------------------------------------------------------+
|  "Come to me all you who are weary and burdened, and I  |
|                  will give you rest."                   |
|                                                         |
|                             -- Jesus Christ (Mt. 11:28) |
+-----------------------+---------------------------------+
| Ernst de Haan         | email mailto:[EMAIL PROTECTED]  |
| Java programmer       | web   members.xoom.com/znerd/   |
+-----------------------+---------------------------------+


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Reply via email to