PostgreSQL Numeric Functions
19 functions
ABSABS(x)Returns the absolute value.
CEILCEIL(x)Returns the ceiling (smallest integer not less than x).
FLOORFLOOR(x)Returns the floor (largest integer not greater than x).
ROUNDROUND(x [, s])Rounds x to s decimal places.
TRUNCTRUNC(x [, s])Truncates x to s decimal places.
MODMOD(n, m)Returns the remainder.
POWERPOWER(x, y)Returns x raised to the power of y.
SQRTSQRT(x)Returns the square root.
EXPEXP(x)Returns e raised to the power of x.
LNLN(x)Returns the natural logarithm.
LOGLOG(b, x)Returns the logarithm base b.
RANDOMRANDOM()Returns a random floating-point value between 0 and 1.
SIGNSIGN(x)Returns 1, 0, or -1 for positive, zero, or negative.
DIVDIV(y, x)Returns the integer quotient of y/x.
GREATESTGREATEST(v, ...)Returns the largest value from a list.
LEASTLEAST(v, ...)Returns the smallest value from a list.
WIDTH_BUCKETWIDTH_BUCKET(v, lo, hi, n)Returns the bucket number for a value in n equal-width buckets.
RADIANSRADIANS(x)Converts degrees to radians.
DEGREESDEGREES(x)Converts radians to degrees.
