w3resource
MySQL Tutorial

PostgreSQL Mathematical and Trigonometric functions

Mathematical and Trigonometric functions

A mathematical function operates on input values ( numeric ) which are provided as arguments and returns a numeric value as the output of that operation. Mathematical functions operate on numeric data.

List of Mathematical Functions

Functions Example Output
abs ( ) abs(-115.36) 115.36
cbrt( ) cbrt ( 343) 7
ceil( ) ceil(-53.7 ) -53
ceiling( ) ceiling(-69.8 ) -69
degrees( ) degrees( .45) 25.783100780887
div( ) div( 19 , 3) 6
exp( ) exp( 2.0 ) 7.3890560989306502
floor( ) floor(-53.6 ) -54
ln( ) ln( 3.0) 1.0986122886681097
log( ) log(200.0 ) 2.3010299956639812
mod( ) mod( 38,5) 3
pi( ) pi( ) 3.14159265358979
power( ) power(7,3 ) 343
radians( ) radians(15.0 )
0.261799387799149
random( ) random( )  
round( ) round( 67.456) 67
sign( ) sign(-14.321 ) -1
sqrt( ) sqrt(225 ) 15
trunc( ) trunc(67.456 ) 67

List of Trigonometric Functions

Functions Syntax Description
acos ( ) acos(a) Returns inverse cosine or arc cosine.
asin( ) asin(a) Returns inverse sine or arc sine.
atan( ) atan(a) Returns inverse tangent or arc tangent.
atan2( ) atan2(b,a) Returns inverse tangent of b/a.
cos( ) cos(a) Returns cosine.
cot( ) cot(a) Returns cotangent.
sin( ) sin(a) Returns sine.
tan( ) tan(a) Returns tangent.

Many of our valued users post comments along with piece of code. Disqus may, false positively, consider those piece of code as Bad or Starnge syntax and send those comments to spam automatically. Even if that happens, we will make sure those useful comments are taken out of spam and approved. It may take a couple of days for that though, but any useful comment will be brought to public view for sure. We regret if that happend to any user. You may write us directly regarding this to - w3resource[at]yahoo[dot]com.