The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Floating point operations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Floating point operations" Watch "Floating point operations" New topic

Floating point operations

Binu K Idicula
Ranch Hand

Joined: Jul 11, 2002
Posts: 99
where can I get some short notes on floating point operations?
Your help needed .. ..
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
One thing to keep in mind here is that Float.MIN_VALUE is the smallest positive value representable as a float. This is very different from Integer.MIN_VALUE which is a large negative number. I wish the designers of Java hadn't used the same name to mean two very different things.
Floating point numbers have a limited amount of precision. If you add Float.MIN_VALUE (1e-45) to either 1 or -1, you will lose precision because there aren't enough bits available to represent 46 decimal places of precision.

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
I agree. Here's the link:
subject: Floating point operations
It's not a secret anymore!