MySQL SIGN() Function – Find Out Whether a Number is Positive or Negative in MySQL

In MySQL, the SIGN() function returns the sign of a number. That is, it indicates whether or not the value is a positive number, a negative number, or zero.

You provide the value as an argument when calling the function.

The function returns the following result, depending on whether the argument is positive, negative, or zero.

  • 1 if the number is positive
  • -1 if the number is negative
  • 0 if the number is zero

Continue reading

MySQL EXP() Function – Return e Raised to the Power of x

In MySQL, the EXP() function returns e raised to the power of a specified value.

You provide the specified value as an argument when calling the function.

The number e is a mathematical constant that is the base of the natural logarithm: the unique number whose natural logarithm is equal to one. It is approximately equal to 2.71828.

Continue reading