wood burning stoves 2.0*
The moose likes Java in General and the fly likes Double value operations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Double value operations" Watch "Double value operations" New topic
Author

Double value operations

dumani jayasinghe
Greenhorn

Joined: Dec 03, 2008
Posts: 29
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
Sheriff

Joined: Sep 28, 2004
Posts: 18543
    
  40


See point 20 of the beginners FAQ.

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

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
dumani jayasinghe
Greenhorn

Joined: Dec 03, 2008
Posts: 29
Thank you very much Henry Wong.It helps me to have a good knowledge in java basics.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

That's not just in Java, that's general computing. You will run into the same issue in (almost) every programming language there is.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: Double value operations
 
Similar Threads
format double
unary operators
Parameter dependent Method call
please, explain how the answer was gotten
Casting doubles to bytes