DocumentDB SQL Mathematical Function - DocumentDB SQL

What is Mathematical Function In DocumentDB SQL?

The mathematical functions perform a calculations based on input values that are provided as arguments, and return a numeric value.

The supported built-in mathematical functions in DocumentDB are as follows:

S.No.
Function & Description
1
ABS (num_expr)
Returns the absolute (positive) value of the specified numeric expression.
2
CEILING (num_expr)
Returns the smallest integer value greater than, or equal to, the specified numeric expression.
3
FLOOR (num_expr)
Returns the largest integer less than or equal to the specified numeric expression.
4
EXP (num_expr)
Returns the exponent of the specified numeric expression.
5
LOG (num_expr [,base])
Returns the natural logarithm of the specified numeric expression, or the logarithm using the specified base.
6
LOG10 (num_expr)
Returns the base-10 logarithmic value of the specified numeric expression.
7
ROUND (num_expr)
Returns a numeric value, rounded to the closest integer value.
8
TRUNC (num_expr)
Returns a numeric value, truncated to the closest integer value.
9
SQRT (num_expr)
Returns the square root of the specified numeric expression.
10
SQUARE (num_expr)
Returns the square of the specified numeric expression.
11
POWER (num_expr, num_expr)
Returns the power of the specified numeric expression to the value specified.
12
SIGN (num_expr)
Returns the sign value (-1, 0, 1) of the specified numeric expression.
13
ACOS (num_expr)
Returns the angle, in radians, whose cosine is the specified numeric expression; also called arccosine.
14
ASIN (num_expr)
Returns the angle, in radians, whose sine is the specified numeric expression. This is also called arcsine.
15
ATAN (num_expr)
Returns the angle, in radians, whose tangent is the specified numeric expression. This is also called arctangent.
16
ATN2 (num_expr)
Returns the angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x), where x and y are the values of the two specified float expressions.
17
COS (num_expr)
Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.
18
COT (num_expr)
Returns the trigonometric cotangent of the specified angle, in radians, in the specified numeric expression.
19
DEGREES (num_expr)
Returns the corresponding angle in degrees for an angle specified in radians.
20
PI ()
Returns the constant value of PI.
21
RADIANS (num_expr)
Returns radians when a numeric expression, in degrees, is entered.
22
SIN (num_expr)
Returns the trigonometric sine of the specified angle, in radians, in the specified expression.
23
TAN (num_expr)
Returns the tangent of the input expression, in the specified expression.

The usage of the built in functions is illustrated in the below example:

builtin mathematical functions

The query in which you can see the numeric rounding functions, ROUND, CEILING, FLOOR, as well as the absolute value, sin, cosign, tangent, natural logarithm, and pi functions are showing in the following code:

The above query is executed and the following result is obtained.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

DocumentDB SQL Topics