Bookmark Topic Watch Topic
  • New Topic

Precision problem with Java  RSS feed

 
Marcel Caraciolo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi!
I'm with a little problem in Java...
If anyone could help, please...

I have this little calculation to do with java:
x = 51.9396/60;
The problem it's the result that's 0.865.
but the real thing it's the result is more precise than that... It's 0.864999999999...
And i want this exactly result (with only showing 15 positions of precision)
I've already tried using BigDecimal.. but the problem persists: Here it~s the code:

If anyone could help...

thks ,

Marcel
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue this discussion under the original topic, and do not post duplicates. Thanks!
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!