Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opposite of the ABS function

Tags:

sql

I know that with ABS() you can convert negative numbers to positive numbers.
But with what function do you convert a positive number to a negative number?
Is there even any?

like image 592
Tenzin Avatar asked Nov 09 '16 11:11

Tenzin


People also ask

What is the opposite operation of absolute value?

An absolute value function (without domain restriction) has an inverse that is NOT a function. That's why by “default”, an absolute value function does not have an inverse function (as you will see in the first example below).

What is the opposite of absolute value in Excel?

You can apply the Multiplication (*) operator as the opposite of the ABS function in Excel. Here, with this formula, you can convert the positive values into negative ones. On the other hand, the negative values will turn into positive ones.


1 Answers

-ABS(x)

e.g.

select -abs(123),-abs(-123)

-abs(123) -abs(-123) 
--------- ---------- 
-123      -123     
like image 76
David דודו Markovitz Avatar answered Oct 14 '22 14:10

David דודו Markovitz