Convert any number to positive. How?

$\begingroup$

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.

$\endgroup$ 1

2 Answers

$\begingroup$

With a calculator, you could make a number positive in one of two (simple) ways:

  • $\text{abs}(x)$
  • $\sqrt{(x^2)}$

The first one is recommended, but the second one will work as well as the square root function on most calculators returns the positive root. Squaring a real number always makes it positive, so taking the square root of a number squared returns the positive number.

$\endgroup$ 6 $\begingroup$

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.

$\endgroup$ 2

You Might Also Like