# Weird \*\*\* math problem... someone help!

**URL:** https://forum.kirupa.com/t/weird-math-problem-someone-help/71857
**Category:** flash
**Created:** [November 30, 2004, 4:07am UTC](https://forum.kirupa.com/t/weird-math-problem-someone-help/71857 "2004-11-30T04:07:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![adityagaddam](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@adityagaddam](https://forum.kirupa.com/u/adityagaddam)
#### Post date: [November 30, 2004, 4:07am UTC](https://forum.kirupa.com/t/weird-math-problem-someone-help/71857/1 "2004-11-30T04:07:53Z")

</div>

Ok I have the following code on a movieClip (its a circle)

```auto

onClipEvent (load) {
	q_button_main = 1;
	tarRotation = 0;
}
onClipEvent (enterFrame) {
	tarRotation = (q_button_main - 1) * 90;
	if(_rotation < 0){
		trace(_rotation);
		trace(360 - Math.abs(_rotation));
		_rotation = 360 - Math.abs(_rotation);
		trace("here");
		trace(_rotation);
	}
	_rotation += (tarRotation - _rotation)/2;
}

```

When q\_button\_main is 4, things get really weird for some reason. for the traces I get the following

```auto

-157.5
202.5 <-----
here
-157.5 <----
-143.4375
216.5625
here
-143.4375
-141.6796875
218.3203125
here
-141.6796875
...goes on and on... never stops at the angle I want it to stop at (which is 270)...

```

Weird part is, the two values with the arrows to them should be exactly the same. I dont know why a calculation in the trace is different from an assignment statement.

Help!  
-Aditya
