w3resource

PostgreSQL POWER() function

POWER() function

The PostgreSQL power() function is used to return the value of one number raised to the power of another number, provided in the argument.

Uses of POWER() Function
  • Exponential Calculations: To perform calculations involving exponentiation.

  • Mathematical Operations: Useful in various mathematical formulas that require raising a number to a power.

  • Scientific Research: Employed in scientific computations involving growth rates, decay, and other exponential models.

  • Financial Modeling: To calculate compound interest and other financial scenarios requiring exponentiation.

  • Engineering Applications: Important in engineering calculations involving power and exponential growth.

Syntax:

power()

PostgreSQL Version: 9.3

Pictorial presentation of PostgreSQL POWER() function

pictorial presentation of PostgreSQL POWER() function

Example 1: PostgreSQL POWER() function :

Code:

SELECT POWER(7.0,3) AS "7 raised to the power of 3";

Sample Output:

 7 raised to the power of 3
----------------------------
       343.0000000000000000
(1 row)

Example 2: PostgreSQL POWER() function

Code:

SELECT POWER(7,3) AS "7 raised to the power of 3";

Sample Output:

 7 raised to the power of 3
----------------------------
                        343
(1 row)

Previous: PI function
Next: RADIANS function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/PostgreSQL/power-function.php