Results 1 to 3 of 3
Thread: Strange double counting
- 03-08-2010, 06:44 AM #1
Member
- Join Date
- Nov 2009
- Posts
- 54
- Rep Power
- 0
Strange double counting
Hey,
I have some problems when i want to a double to another, an example:
0.3+0.1 =0.39999999... .
Code:
Can someone explain me what the problem is?Java Code:double lowest=0.0; double highest=1.0; double interval=0.1 int meeteller=0; for( double count=lowest;count<=highest;count+=interval,meeteller++) { g.drawString(count+"", 10, (int) ( heigth-( meeteller*pixelInterval ) ) ); }
Hannes
- 03-08-2010, 07:00 AM #2
- 03-08-2010, 07:09 AM #3
Member
- Join Date
- Nov 2009
- Posts
- 54
- Rep Power
- 0
Similar Threads
-
Counting help
By jksmithson in forum New To JavaReplies: 1Last Post: 11-06-2009, 02:43 AM -
Check if double is double
By marshalthrone in forum New To JavaReplies: 8Last Post: 09-30-2009, 02:51 PM -
non-static method add(double,double) cannot be referenced from a static context
By cravi85 in forum Java SoftwareReplies: 5Last Post: 03-21-2009, 09:32 PM -
Recursive Counting
By zlwilly in forum New To JavaReplies: 1Last Post: 01-29-2009, 08:42 PM -
Double.valueOf() vs Double.parseDouble()
By greenbean in forum New To JavaReplies: 10Last Post: 01-12-2009, 08:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks