12 Replies Latest reply: Dec 22, 2009 8:59 AM by dcminter RSS

    Need help with calculating floating point numbers in JAVA

    807580
      Hi,

      I am using JDK1.5.0_07. I performed a particular calculation in JAVA - 4671.11 * 100
      The value returned is 467110.99999999994 instead of 467111.

      The reason being 4671.11 cannot be represented exactly in floating point.

      Can anyone please tell me which are the other numbers in JAVA which cannot be represented as floating point numbers.

      Thanks,