Article View: borland.public.jbuilder.java.api
Article #2255Odp: Simple problem for float calculation
From: Damian
Date: Wed, 11 Apr 2001 17:10
Date: Wed, 11 Apr 2001 17:10
23 lines
1298 bytes
1298 bytes
Simply use java.math.BigDecimal -- --- Damian damian.golda@poczta.fm U�ytkownik eLe <petruschan@realink.com.hk> w wiadomo�ci do grup dyskusyjnych napisa�:39ec3576_2@dnews... > I have Java program simple as : > > float a = 27.1 > float b = 0.2 > float c = a + b > c = 27.300001 > > I want the ans is c = 27.3 is not 27.300001 > > How to solve this problem ? thank you ! > >
Technical Details
Message-ID:
<3ad48fa8_2@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!netnews.com!opentransit.net!fr.clara.net!heighliner.fr.clara.net!RENT.THIS.SPACE.FOR.ADVERTISING!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<39ec3576_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: POLISH,Latin2 X-Google-Thread: 1089d0,9bcc96b038465cb3 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-04-11 10:14:09 PST From: "Damian" <damian.golda@poczta.fm> Newsgroups: borland.public.jbuilder.java.api References: <39ec3576_2@dnews> Subject: Odp: Simple problem for float calculation Date: Wed, 11 Apr 2001 19:10:52 +0200 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2417.2000 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 213.25.22.133 Message-ID: <3ad48fa8_2@dnews> X-Trace: dnews 987008936 213.25.22.133 (11 Apr 2001 10:08:56 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!netnews.com!opentransit.net!fr.clara.net!heighliner.fr.clara.net!RENT.THIS.SPACE.FOR.ADVERTISING!newsfeed01.sul.t-online.de!t-online.de!dnews