# Numbers in AS2 misbehaving

**URL:** <https://forum.kirupa.com/t/numbers-in-as2-misbehaving/304194>\
**Category:** flash\
**Created:** [February 3, 2010, 2:07am UTC](https://forum.kirupa.com/t/numbers-in-as2-misbehaving/304194 "2010-02-03T02:07:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mavoric](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@mavoric](https://forum.kirupa.com/u/mavoric)\
**Post date:** [February 3, 2010, 2:07am UTC](https://forum.kirupa.com/t/numbers-in-as2-misbehaving/304194/1 "2010-02-03T02:07:26Z")

</div>

I seem to be having a strange problem with a flash variable whilst creating an isometric game. The variable is created as follows…

[COLOR=DimGray]_i is an array_\*  
tiles,current\_sub and x are all objects\*[/COLOR]

```auto

add_group*['tiles']['current_sub']['x'] = 1;     
add_group*['tiles']['current_sub']['y'] = 2;
level.live_groups.push(add_group);

```

Then in a loop on the next frame…  
[COLOR=DimGray]_g,p are arrays  
tiles,current\_sub,x,y are objects_[/COLOR]

```auto

currentX = level.live_groups[g][p]['tiles']['current_sub']['x'];
currentY = level.live_groups[g][p]['tiles']['current_sub']['y'];
movetoY = level.live_groups[g][p]['tiles']['route'][nextmove]['0'];
movetoX = level.live_groups[g][p]['tiles']['route'][nextmove]['1'];

if(currentX > movetoX) 
{
    new_pos_X = currentX-0.1;
}
else if(currentX < movetoX)
{
    new_pos_X = currentX+0.1;
}
else
{
    new_pos_X = movetoX;
    in_X = true;
}
if(currentY > movetoY)
{
    new_pos_Y = currentY-0.1;
}
else if(currentY < movetoY)
{
    new_pos_Y = currentY+0.1;
}
else
{
    new_pos_Y = movetoY;
    in_Y = true;
}

level.live_groups[g][p]['tiles']['current_sub']['x'] = new_pos_X;
level.live_groups[g][p]['tiles']['current_sub']['y'] = new_pos_Y;

```

btw it moves to 1,0

On y this goes down 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 1.38777878078145e-16

And I cant understand why it goes from  
0.1 to 1.38777878078145e-16  
when it should go to 0.

Thanks in advance for any reply 🙂
