File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes data types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "data types" Watch "data types" New topic
Author

data types

Thimal Deemantha
Greenhorn

Joined: Nov 02, 2012
Posts: 9



Why the output is 3.2300000190734863
except 3.23
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13870
    
  10

Because the float and double data types are not infinitely precise; you can get rounding errors when you start doing calculations with them.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Thimal Deemantha
Greenhorn

Joined: Nov 02, 2012
Posts: 9
Jesper de Jong wrote:Because the float and double data types are not infinitely precise; you can get rounding errors when you start doing calculations with them.


THANK YOU
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: data types
 
Similar Threads
Recursion help
How is huge Integer value converted to float
Is there a URL that explains[ y = x++ + ++x; ] ?
Scala exercises for beginners (in FP)
compilation error...