Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Double value operations

 
dumani jayasinghe
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Please help me to clarify the given matter.

double a=1.0
double b=0.01


i got the value 0.009999....8 for a mode b .Please any one can explain me this.

Thnx a lot
 
Henry Wong
author
Marshal
Pie
Posts: 21405
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

See point 20 of the beginners FAQ.

http://www.coderanch.com/how-to/java/JavaBeginnersFaq

Henry
 
dumani jayasinghe
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Henry Wong.It helps me to have a good knowledge in java basics.
 
Rob Spoor
Sheriff
Pie
Posts: 20608
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not just in Java, that's general computing. You will run into the same issue in (almost) every programming language there is.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic