# Issue with numbers

**URL:** <https://forum.kirupa.com/t/issue-with-numbers/255704>\
**Category:** flash\
**Created:** [March 26, 2008, 2:25am UTC](https://forum.kirupa.com/t/issue-with-numbers/255704 "2008-03-26T02:25:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cytech](https://avatars.discourse-cdn.com/v4/letter/c/f4b2a3/32.png) [@cytech](https://forum.kirupa.com/u/cytech)\
**Post date:** [March 26, 2008, 2:25am UTC](https://forum.kirupa.com/t/issue-with-numbers/255704/1 "2008-03-26T02:25:27Z")

</div>

Hey All,

I am having issues subtracting numbers – yes subtracting haha

Basically I add 0.99 + 0.99 + 0.99

I get: 2.97 - great!

Now when I subtract 0.99 one at a time (using AS) It goes like this:  
2.97 - 0.99 = 1.98  
1.98 - 0.99 = 0.99  
0.99 - 0.99 = -2.22044604925031e-16

?? how did we get that number 🙂

My code

total\_price is defined as a number and starts at 0.00.

Eg: var total\_price:Number = 0.00;

songs is an array that contains information about each song that is loaded - in the multi-level array number 5 represents the price of the song. Which on eash song is defaulted to 0.99.

```auto

function addItem(element){
    var track = substring(element, 27, 1);
    _root.total_price+=Number(songs[track][5]);
    _root.price.cost.text="$"+_root.total_price;
    }

function removeItem(element){
    var track = substring(element, 27, 1);
    _root.total_price-=Number(songs[track][5]);
    _root.price.cost.text="$"+_root.total_price;
    }

```

Anyone have any clue why I get such a random number such as “-2.22044604925031e-16”?

If I remove and add only 2 sets of 0.99 is comes out 0 - its only when I do more then 2 calculations.

Thanks for any advice!
