Mathematical operators are provided for many Advanced Server types. For types without common mathematical conventions for all possible permutations (e.g., date/time types) the actual behavior is described in subsequent sections.
The following table shows the available mathematical functions. Many of these functions are provided in multiple forms with different argument types. Except where noted, any given form of a function returns the same data type as its argument. The functions working with DOUBLE PRECISION data are mostly implemented on top of the host system’s C library; accuracy and behavior in boundary cases may therefore vary depending on the host system.
ABS(x) Same as x LOG(b NUMBER, x NUMBER) MOD(y, x) Remainder of y/x NVL(x, y) If x is null, then NVL returns y POWER(a DOUBLE PRECISION, b DOUBLE PRECISION) a raised to the power of b POWER(a NUMBER, b NUMBER) a raised to the power of b ROUND(v NUMBER, s INTEGER) Round to s decimal places TRUNC(v NUMBER, s INTEGER) WIDTH_BUCKET(op NUMBER, b1 NUMBER, b2 NUMBER, count INTEGER) Return the bucket to which op would be assigned in an equidepth histogram with count buckets, in the range b1 to b2 The following table shows the available trigonometric functions. All trigonometric functions take arguments and return values of type DOUBLE PRECISION.
ACOS(x) ASIN(x) ATAN(x) ATAN2(x, y) COS(x) SIN(x) TAN(x)