# Flash does math wrong, or, I do... you decide

**URL:** <https://forum.kirupa.com/t/flash-does-math-wrong-or-i-do-you-decide/20296>\
**Category:** Uncategorized\
**Created:** [May 7, 2003, 6:54am UTC](https://forum.kirupa.com/t/flash-does-math-wrong-or-i-do-you-decide/20296 "2003-05-07T06:54:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jingman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jingman/32/163_2.png) [@jingman](https://forum.kirupa.com/u/jingman)\
**Post date:** [May 7, 2003, 6:54am UTC](https://forum.kirupa.com/t/flash-does-math-wrong-or-i-do-you-decide/20296/1 "2003-05-07T06:54:31Z")

</div>

I have these dials. I want to add 0.1 to the “dial value” when you press it. I have the results of this value spit out to a dynamic text box.

My problem is: Right at “6” (so, it just said 5.9), it shows me 5.999999999 ! Flash is subtracting, what, billionths? from my numbers!

To remedy this problem I throw this line in there:

\_root.dial.value = (Math.round(\_root.dial.value\*10.0))/10.0;

This seems to work, but why is flash doing math wrong?

Can flash not add the entire “0.1” before it jumps to the next frame? How would you old wise men sove this problem?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2003, 7:11am UTC](https://forum.kirupa.com/t/flash-does-math-wrong-or-i-do-you-decide/20296/2 "2003-05-07T07:11:42Z")

</div>

[http://www.macromedia.com/support/flash/ts/documents/roundoff\_error.htm](http://www.macromedia.com/support/flash/ts/documents/roundoff_error.htm) :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2003, 7:15am UTC](https://forum.kirupa.com/t/flash-does-math-wrong-or-i-do-you-decide/20296/3 "2003-05-07T07:15:50Z")

</div>

NOOOOO! I thought I had searched everywhere! Thanks kax.

I love the solution “this is a fact of life” Ahaha, that’s gold.

If I want to do precise math, do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2003, 7:22am UTC](https://forum.kirupa.com/t/flash-does-math-wrong-or-i-do-you-decide/20296/4 "2003-05-07T07:22:03Z")

</div>

don’t thank me… i got the link from senocular ([Flash Limits](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=16877)). 😉

and no, i don’t have any suggestions… sorry. ☹
