|
1 | | ---- |
2 | | -title: "Mathematical Functions (Transact-SQL)" |
3 | | -description: "Mathematical Functions (Transact-SQL)" |
4 | | -author: markingmyname |
5 | | -ms.author: maghan |
6 | | -ms.date: "07/06/2017" |
7 | | -ms.service: sql |
8 | | -ms.subservice: t-sql |
9 | | -ms.topic: reference |
10 | | -helpviewer_keywords: |
11 | | - - "calculations [SQL Server]" |
12 | | - - "mathematical functions [SQL Server]" |
13 | | - - "functions [SQL Server], mathematical" |
14 | | -dev_langs: |
15 | | - - "TSQL" |
16 | | -monikerRange: "= azuresqldb-current || = azuresqldb-mi-current || >= sql-server-2016 || >= sql-server-linux-2017 || = azuresqledge-current || = azure-sqldw-latest || >= aps-pdw-2016||=fabric" |
17 | | ---- |
18 | | -# Mathematical Functions (Transact-SQL) |
19 | | -[!INCLUDE [sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw.md)] |
20 | | - |
21 | | -The following scalar functions perform a calculation, usually based on input values that are provided as arguments, and return a numeric value: |
22 | | - |
23 | | -- [ABS](../../t-sql/functions/abs-transact-sql.md) |
24 | | -- [ACOS](../../t-sql/functions/acos-transact-sql.md) |
25 | | -- [ASIN](../../t-sql/functions/asin-transact-sql.md) |
26 | | -- [ATAN](../../t-sql/functions/atan-transact-sql.md) |
27 | | -- [ATN2](../../t-sql/functions/atn2-transact-sql.md) |
28 | | -- [CEILING](../../t-sql/functions/ceiling-transact-sql.md) |
29 | | -- [COS](../../t-sql/functions/cos-transact-sql.md) |
30 | | -- [COT](../../t-sql/functions/cot-transact-sql.md) |
31 | | -- [DEGREES](../../t-sql/functions/degrees-transact-sql.md) |
32 | | -- [EXP](../../t-sql/functions/exp-transact-sql.md) |
33 | | -- [FLOOR](../../t-sql/functions/floor-transact-sql.md) |
34 | | -- [LOG](../../t-sql/functions/log-transact-sql.md) |
35 | | -- [LOG10](../../t-sql/functions/log10-transact-sql.md) |
36 | | -- [PI](../../t-sql/functions/pi-transact-sql.md) |
37 | | -- [POWER](../../t-sql/functions/power-transact-sql.md) |
38 | | -- [RADIANS](../../t-sql/functions/radians-transact-sql.md) |
39 | | -- [RAND](../../t-sql/functions/rand-transact-sql.md) |
40 | | -- [ROUND](../../t-sql/functions/round-transact-sql.md) |
41 | | -- [SIGN](../../t-sql/functions/sign-transact-sql.md) |
42 | | -- [SIN](../../t-sql/functions/sin-transact-sql.md) |
43 | | -- [SQRT](../../t-sql/functions/sqrt-transact-sql.md) |
44 | | -- [SQUARE](../../t-sql/functions/square-transact-sql.md) |
45 | | -- [TAN](../../t-sql/functions/tan-transact-sql.md) |
46 | | - |
47 | | -> [!NOTE] |
48 | | -> Arithmetic functions, such as ABS, CEILING, DEGREES, FLOOR, POWER, RADIANS, and SIGN, return a value having the same data type as the input value. Trigonometric and other functions, including EXP, LOG, LOG10, SQUARE, and SQRT, cast their input values to **float** and return a **float** value. |
49 | | - |
50 | | -All mathematical functions, except for RAND, are deterministic functions. This means they return the same results each time they are called with a specific set of input values. RAND is deterministic only when a seed parameter is specified. For more information about function determinism, see [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md). |
51 | | - |
52 | | -## See Also |
53 | | - |
54 | | -- [Arithmetic Operators (Transact-SQL)](../../t-sql/language-elements/arithmetic-operators-transact-sql.md) |
55 | | -- [Built-in Functions (Transact-SQL)](~/t-sql/functions/functions.md) |
| 1 | +--- |
| 2 | +title: "Mathematical Functions (Transact-SQL)" |
| 3 | +description: Mathematical Transact-SQL functions in the SQL Server Database Engine. |
| 4 | +author: markingmyname |
| 5 | +ms.author: maghan |
| 6 | +ms.reviewer: randolphwest |
| 7 | +ms.date: 12/16/2024 |
| 8 | +ms.service: sql |
| 9 | +ms.subservice: t-sql |
| 10 | +ms.topic: reference |
| 11 | +helpviewer_keywords: |
| 12 | + - "calculations [SQL Server]" |
| 13 | + - "mathematical functions [SQL Server]" |
| 14 | + - "functions [SQL Server], mathematical" |
| 15 | +dev_langs: |
| 16 | + - "TSQL" |
| 17 | +monikerRange: "=azuresqldb-current || =azuresqldb-mi-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqledge-current || =azure-sqldw-latest || >=aps-pdw-2016 || =fabric" |
| 18 | +--- |
| 19 | +# Mathematical functions (Transact-SQL) |
| 20 | + |
| 21 | +[!INCLUDE [sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw.md)] |
| 22 | + |
| 23 | +The following scalar functions perform a calculation, usually based on input values that are provided as arguments, and return a numeric value: |
| 24 | + |
| 25 | +- [ABS](abs-transact-sql.md) |
| 26 | +- [ACOS](acos-transact-sql.md) |
| 27 | +- [ASIN](asin-transact-sql.md) |
| 28 | +- [ATAN](atan-transact-sql.md) |
| 29 | +- [ATN2](atn2-transact-sql.md) |
| 30 | +- [CEILING](ceiling-transact-sql.md) |
| 31 | +- [COS](cos-transact-sql.md) |
| 32 | +- [COT](cot-transact-sql.md) |
| 33 | +- [DEGREES](degrees-transact-sql.md) |
| 34 | +- [EXP](exp-transact-sql.md) |
| 35 | +- [FLOOR](floor-transact-sql.md) |
| 36 | +- [LOG](log-transact-sql.md) |
| 37 | +- [LOG10](log10-transact-sql.md) |
| 38 | +- [PI](pi-transact-sql.md) |
| 39 | +- [POWER](power-transact-sql.md) |
| 40 | +- [RADIANS](radians-transact-sql.md) |
| 41 | +- [RAND](rand-transact-sql.md) |
| 42 | +- [ROUND](round-transact-sql.md) |
| 43 | +- [SIGN](sign-transact-sql.md) |
| 44 | +- [SIN](sin-transact-sql.md) |
| 45 | +- [SQRT](sqrt-transact-sql.md) |
| 46 | +- [SQUARE](square-transact-sql.md) |
| 47 | +- [TAN](tan-transact-sql.md) |
| 48 | + |
| 49 | +Arithmetic functions, such as `ABS`, `CEILING`, `DEGREES`, `FLOOR`, `POWER`, `RADIANS`, and `SIGN`, return a value having the same data type as the input value. Trigonometric and other functions, including `EXP`, `LOG`, `LOG10`, `SQUARE`, and `SQRT`, cast their input values to **float** and return a **float** value. |
| 50 | + |
| 51 | +All mathematical functions, except for `RAND`, are deterministic functions. This means they return the same results each time they're called with a specific set of input values. `RAND` is deterministic only when a seed parameter is specified. For more information about function determinism, see [Deterministic and nondeterministic functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md). |
| 52 | + |
| 53 | +## Related content |
| 54 | + |
| 55 | +- [Arithmetic operators (Transact-SQL)](../language-elements/arithmetic-operators-transact-sql.md) |
| 56 | +- [What are the SQL database functions?](functions.md) |
0 commit comments