# float subtraction gives wild answers?

I have a float variable defined as

`float var = -Mathf.Atan(y/x);`

which gives the expected value of -18 degrees (after converting from rad). However, when I change this line to

`float var = 360-Mathf.Atan(y/x);`

the value of var becomes ~20,000. Why is this happening? Thanks

**Answer** by Alanisaac
·
Feb 25, 2018 at 03:10 PM

which gives the expected value of -18 degrees (after converting from rad)

Degrees/Radians is the issue. I think you want `(2*Math.PI)-Mathf.Atan(y/x);`

**Answer** by roybiv
·
Feb 26, 2018 at 02:12 AM

Thanks for answering, but I found out what the problem was: me. I was converting to radians **after** adding 90. Oops. Thanks anyway

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

Can you do float + float 1 Answer

Int not getting rounded data 0 Answers

Not Checking if Greater than 0 1 Answer