The mathematical built-in functions operate on numeric data. Certain functions require integer data and others approximate numeric data. A number of functions operate on exact numeric, approximate numeric, money, and float types. The precision of built-in operations on float type data is six decimal places by default.
Error traps are provided to handle domain or range errors of the mathematical functions. Users can set the arithabort and arithignore options to determine how domain errors are handled. For more information about these options, see “Conversion errors”.
Table 15-9 displays some simple examples of mathematical functions.
The round(numeric, integer) function always returns a value. If integer is negative and exceeds the number of significant digits in numeric, Adaptive Server rounds only the most significant digit. For example, this returns a value of 100.00:
select round(55.55, -3)
The number of zeros to the right of the decimal point is equal to the scale of the first argument’s precision plus 1.
Copyright © 2005. Sybase Inc. All rights reserved. |