• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I get Calculation to Work

 
Steve Dyke
Ranch Hand
Posts: 1643
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my class. The accrate value comes out to be 0.0 every time.

 
g Peshone
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don�t you check result out of each query before going to next query?
 
Rob Spoor
Sheriff
Pie
Posts: 20608
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Integer division always truncates. Cast to float / double to prevent this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic