12.6 Numeric Functions and Operators

Numeric Functions and Operators

Name Description

'%', 'MOD' Modulo operator

'*' Multiplication operator

'+' Addition operator

'-' Minus operator

'-' Change the sign of the argument

'/' Division operator

'ABS()' Return the absolute value

'ACOS()' Return the arc cosine

'ASIN()' Return the arc sine

'ATAN()' Return the arc tangent

'ATAN2()', Return the arc tangent of the two arguments 'ATAN()'

'CEIL()' Return the smallest integer value not less than the argument

'CEILING()' Return the smallest integer value not less than the argument

'CONV()' Convert numbers between different number bases

'COS()' Return the cosine

'COT()' Return the cotangent

'CRC32()' Compute a cyclic redundancy check value

'DEGREES()' Convert radians to degrees

'DIV' Integer division

'EXP()' Raise to the power of

'FLOOR()' Return the largest integer value not greater than the argument

'LN()' Return the natural logarithm of the argument

'LOG()' Return the natural logarithm of the first argument

'LOG10()' Return the base-10 logarithm of the argument

'LOG2()' Return the base-2 logarithm of the argument

'MOD()' Return the remainder

'PI()' Return the value of pi

'POW()' Return the argument raised to the specified power

'POWER()' Return the argument raised to the specified power

'RADIANS()' Return argument converted to radians

'RAND()' Return a random floating-point value

'ROUND()' Round the argument

'SIGN()' Return the sign of the argument

'SIN()' Return the sine of the argument

'SQRT()' Return the square root of the argument

'TAN()' Return the tangent of the argument

'TRUNCATE()' Truncate to specified number of decimal places

 File: manual.info.tmp, Node: arithmetic-functions, Next: mathematical-functions, Prev: numeric-functions, Up: numeric-functions

12.6.1 Arithmetic Operators

Arithmetic Operators

Name Description

'%', 'MOD' Modulo operator

'*' Multiplication operator

'+' Addition operator

'-' Minus operator

'-' Change the sign of the argument

'/' Division operator

'DIV' Integer division

The usual arithmetic operators are available. The result is determined according to the following rules:

These rules are applied for each operation, such that nested calculations imply the precision of each component. Hence, '(14620 / 9432456) / (24250 / 9432456)', resolves first to '(0.0014) / (0.0026)', with the final result having 8 decimal places ('0.60288653').

Because of these rules and the way they are applied, care should be taken to ensure that components and subcomponents of a calculation use the appropriate level of precision. See *note cast-functions::.

For information about handling of overflow in numeric expression evaluation, see *note out-of-range-and-overflow::.

Arithmetic operators apply to numbers. For other types of values, alternative operations may be available. For example, to add date values, use 'DATE_ADD()'; see *note date-and-time-functions::.

 File: manual.info.tmp, Node: mathematical-functions, Prev: arithmetic-functions, Up: numeric-functions

12.6.2 Mathematical Functions

Mathematical Functions

Name Description

'ABS()' Return the absolute value

'ACOS()' Return the arc cosine

'ASIN()' Return the arc sine

'ATAN()' Return the arc tangent

'ATAN2()', Return the arc tangent of the two arguments 'ATAN()'

'CEIL()' Return the smallest integer value not less than the argument

'CEILING()' Return the smallest integer value not less than the argument

'CONV()' Convert numbers between different number bases

'COS()' Return the cosine

'COT()' Return the cotangent

'CRC32()' Compute a cyclic redundancy check value

'DEGREES()' Convert radians to degrees

'EXP()' Raise to the power of

'FLOOR()' Return the largest integer value not greater than the argument

'LN()' Return the natural logarithm of the argument

'LOG()' Return the natural logarithm of the first argument

'LOG10()' Return the base-10 logarithm of the argument

'LOG2()' Return the base-2 logarithm of the argument

'MOD()' Return the remainder

'PI()' Return the value of pi

'POW()' Return the argument raised to the specified power

'POWER()' Return the argument raised to the specified power

'RADIANS()' Return argument converted to radians

'RAND()' Return a random floating-point value

'ROUND()' Round the argument

'SIGN()' Return the sign of the argument

'SIN()' Return the sine of the argument

'SQRT()' Return the square root of the argument

'TAN()' Return the tangent of the argument

'TRUNCATE()' Truncate to specified number of decimal places

All mathematical functions return 'NULL' in the event of an error.

 File: manual.info.tmp, Node: date-and-time-functions, Next: string-functions, Prev: numeric-functions, Up: functions