🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Question about mathemathics.

#15099
From: Alexander Stanev
Date: Thu, 08 Jul 1999 00:00
11 lines
817 bytes
What is wrong with Java mathematics?
I wrote:
double x = 1.255;
double y = 0;
y = x + 0.005;
As a rezult I receive y = 1.2599999999999998.
Why?
When I use float everything is allwrite, but compiler enforce me to cast to
float allmost everything.
Thank You in advance and excuse me for my english.
Alex.
Technical Details
Message-ID: <7m25jr$heu6@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,f8b18e8225438be9,start
X-Google-Attributes: gidf74b3,public
From: "Alexander Stanev" <a_stanev@iname.com>
Subject: Question about mathemathics.
Date: 1999/07/08
Message-ID: <7m25jr$heu6@forums.borland.com>
X-Deja-AN: 498533196
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.language