--- description: "EXP (Transact-SQL)" title: "EXP (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/06/2017" ms.prod: sql ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw" ms.reviewer: "" ms.technology: t-sql ms.topic: reference f1_keywords: - "EXP_TSQL" - "EXP" dev_langs: - "TSQL" helpviewer_keywords: - "exponential functions" - "EXP function" ms.assetid: 5a9b8c52-6fb6-4e33-8b02-a878785b2f51 author: cawrites ms.author: chadam monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current" --- # EXP (Transact-SQL) [!INCLUDE [sql-asdb-asdbmi-asa-pdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)] Returns the exponential value of the specified **float** expression. ![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ```syntaxsql EXP ( float_expression ) ``` [!INCLUDE[sql-server-tsql-previous-offline-documentation](../../includes/sql-server-tsql-previous-offline-documentation.md)] ## Arguments *float_expression* Is an [expression](../../t-sql/language-elements/expressions-transact-sql.md) of type **float** or of a type that can be implicitly converted to **float**. ## Return Types **float** ## Remarks The constant **e** (2.718281...), is the base of natural logarithms. The exponent of a number is the constant **e** raised to the power of the number. For example EXP(1.0) = e^1.0 = 2.71828182845905 and EXP(10) = e^10 = 22026.4657948067. The exponential of the natural logarithm of a number is the number itself: EXP (LOG (*n*)) = *n*. And the natural logarithm of the exponential of a number is the number itself: LOG (EXP (*n*)) = *n*. ## Examples ### A. Finding the exponent of a number The following example declares a variable and returns the exponential value of the specified variable (`10`) with a text description. ```sql DECLARE @var FLOAT SET @var = 10 SELECT 'The EXP of the variable is: ' + CONVERT(VARCHAR, EXP(@var)) GO ``` [!INCLUDE[ssResult](../../includes/ssresult-md.md)] ``` ---------------------------------------------------------- The EXP of the variable is: 22026.5 (1 row(s) affected) ``` ### B. Finding exponentials and natural logarithms The following example returns the exponential value of the natural logarithm of `20` and the natural logarithm of the exponential of `20`. Because these functions are inverse functions of one another, the return value in both cases is `20`. ```sql SELECT EXP(LOG(20)), LOG(EXP(20)) GO ``` [!INCLUDE[ssResult](../../includes/ssresult-md.md)] ``` ---------------------- ---------------------- 20 20 (1 row(s) affected) ``` ## Examples: [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)] ### C. Finding the exponent of a number The following example returns the exponential value of the specified value (`10`). ```sql SELECT EXP(10); ``` [!INCLUDE[ssResult](../../includes/ssresult-md.md)] ``` ---------- 22026.4657948067 ``` ### D. Finding exponential values and natural logarithms The following example returns the exponential value of the natural logarithm of `20` and the natural logarithm of the exponential of `20`. Because these functions are inverse functions of one another, the return value in both cases is `20`. ```sql SELECT EXP( LOG(20)), LOG( EXP(20)); ``` [!INCLUDE[ssResult](../../includes/ssresult-md.md)] ``` -------------- ----------------- 20 20 ``` ## See Also [Mathematical Functions (Transact-SQL)](../../t-sql/functions/mathematical-functions-transact-sql.md) [LOG (Transact-SQL)](../../t-sql/functions/log-transact-sql.md) [LOG10 (Transact-SQL)](../../t-sql/functions/log10-transact-sql.md)