# Floating point operations

Binu K Idicula

Ranch Hand

Posts: 99

Ron Newman

Ranch Hand

Posts: 1056

posted 14 years ago

One thing to keep in mind here is that Float.MIN_VALUE is the smallest

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.

**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)