# Convert any number to positive. How?

How to convert any number (negative or positive) into a positive number.. For example, my input can be 4545 or -4545, I need the out come to be positive value 4545.

-

You just have to simply multiply by $-1$. For example if you have a number $-a$ then multiply by $-1$ to get $-a \times -1 =a$. If the number is positive then multiply by $1$.

Or if you are aware of the Absolute Value, then take the absolute value of the number.

-
This is the problem. I am getting the first value from an equation. I do not know it would be positive or negative. But I want it in positive. So I need to apply some equation on it if I am right. –  Muneer May 28 '11 at 7:04
cool. Absolute Value is working. –  Muneer May 28 '11 at 7:11
• $\text{abs}(x)$
• $\sqrt{(x^2)}$
Yes, by all means use $\operatorname{abs}(x)$! You don't want to waste time squaring and taking roots (you'll also have to cope with imprecisions)... –  t.b. May 28 '11 at 7:10
In textbooks, the first one is often written $\lvert x\rvert$. –  FUZxxl May 28 '11 at 8:57