# Weird Problem with AS

**URL:** <https://forum.kirupa.com/t/weird-problem-with-as/225066>\
**Category:** flash\
**Created:** [May 8, 2007, 3:36pm UTC](https://forum.kirupa.com/t/weird-problem-with-as/225066 "2007-05-08T15:36:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewi\_p](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@lewi\_p](https://forum.kirupa.com/u/lewi_p)\
**Post date:** [May 8, 2007, 3:36pm UTC](https://forum.kirupa.com/t/weird-problem-with-as/225066/1 "2007-05-08T15:36:37Z")

</div>

Hi, I don’t need help with this but I thought I’d post it to bring attention to this…

I’ve just tired doing a simple sum but AS is adding an extra 0.01 to my equations for some reason. All I’m doing is taking a value, adding 100, then subtracting 100 but getting a different result from what I started with!

```
 ActionScript Code:
 [FONT=Courier New][LEFT][COLOR=#808080]*// Start off with a value*[/COLOR]

```

[COLOR=#000000] **var** [/COLOR] myValue:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#000080]7[/COLOR].[COLOR=#000080]6[/COLOR];  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#808080]_// Add 100 to myValue_[/COLOR]  
[COLOR=#000000] **var** [/COLOR] myValue:[COLOR=#0000ff]Number[/COLOR] = myValue+[COLOR=#000080]100[/COLOR];  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#808080]_// Subtract 100 from myValue, should be 7.6_[/COLOR]  
[COLOR=#000000] **var** [/COLOR] myValue:[COLOR=#0000ff]Number[/COLOR] = myValue-[COLOR=#000080]100[/COLOR];  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[/LEFT]  
[/FONT]

Very strange!

lewi-p
