This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 14998
    
  27

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 8 API documentation
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
 
It's not a secret anymore!