4 Replies Latest reply on Mar 26, 2014 2:47 PM by GordonSmith

    Sum with negative Number

    ndt.company

      Hi All,

       

      I have problem when sum negative number.

      Here is sample:

      var a:Number = 4.2;

      var b:Number = 4.4;

      var c:Number = -8.6;

      var total:Number = a+b+c;

      The value of total = 1.7763568394002505E-15. So strange, the value of total should is 0.

      Anybody can help me explain this problem in actionscript and how to fix it ?

       

      Thanks,

      ndt