Numeric functions focus on number calculations.
These functions expect numeric arguments, like integer, decimals, etc.
The return values are numeric also.
This function returns the square root of the specified number.
SELECT SQRT(16) AS 'SQRT 16'
SQRT 16 |
---|
4 |
These are the built-in numeric functions in SQL Server.
Click on a function for more details.
Function | Description |
---|---|
ABS | Returns the absolute value of a number |
ACOS | Returns the arc cosine of a number, expressed as an angle in radians |
ASIN | Returns the arc sine of a number, expressed as an angle in radians |
ATAN | Returns the arc tangent of a number, expressed as an angle in radians |
ATN2 | Returns the arctangent of x and y, expressed as an angle in radians |
CEILING | Returns the closest integer value greater than a given number |
COS | Returns the cosine of an angle in radians |
COT | Returns the cotangent of an angle in radians |
DEGREES | Converts an angle from radians to degrees |
EXP | Returns the exponential value of a number |
FLOOR | Returns the closest integer value smaller than a given number |
LOG | Returns the natural logarithm of a number |
LOG10 | Returns the base 10 logarithm of a number |
PI | Returns the constant value pi (3.1415..) |
POWER | Returns the value of a number to the power of a given integer |
RADIANS | Converts an angle from degrees to radians |
RAND | Returns a random number between 0 and 1 |
ROUND | Returns a rounded number a specified number of decimals. |
SIGN | Returns an indicator (-1, 0, -1) of the sign of a number |
SQRT | Returns the square root of a number |
SQUARE | Returns the squared value of a number |
TAN | Returns the tangent of a number, which is an angle in radians. |