EXP (Transact-SQL)EXP (Transact-SQL)
適用対象:Applies to: SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
指定した指数値を返します float 式です。Returns the exponential value of the specified float expression.
Transact-SQL 構文表記規則
Transact-SQL Syntax Conventions
構文Syntax
EXP ( float_expression )
注意
SQL Server 2014 以前の Transact-SQL 構文を確認するには、以前のバージョンのドキュメントを参照してください。To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
引数Arguments
float_expressionfloat_expression
float 型、または暗黙的に float 型に変換できる 式を指定します。Is an expression of type float or of a type that can be implicitly converted to float.
戻り値の型Return Types
floatfloat
注釈Remarks
定数 e (2.718281…) は、自然対数の底です。The constant e (2.718281...), is the base of natural logarithms.
数値の指数部は、定数 e を数値で累乗した値です。The exponent of a number is the constant e raised to the power of the number. たとえば、EXP(1.0) = e^1.0 = 2.71828182845905 および EXP(10) = e^10 = 22026.4657948067 になります。For example EXP(1.0) = e^1.0 = 2.71828182845905 and EXP(10) = e^10 = 22026.4657948067.
数値の自然対数の指数は、その数値自体です。つまり、EXP (LOG (n)) = n です。The exponential of the natural logarithm of a number is the number itself: EXP (LOG (n)) = n. また、数値の指数の自然対数は、その数値自体です。つまり、LOG (EXP (n)) = n です。And the natural logarithm of the exponential of a number is the number itself: LOG (EXP (n)) = n.
例Examples
A.A. 数値の指数を計算するFinding the exponent of a number
次の例では、変数を宣言し、指定した変数 (10
) の指数値とテキストの説明を返します。The following example declares a variable and returns the exponential value of the specified variable (10
) with a text description.
DECLARE @var FLOAT
SET @var = 10
SELECT 'The EXP of the variable is: ' + CONVERT(VARCHAR, EXP(@var))
GO
結果セットは次のようになります。Here is the result set.
----------------------------------------------------------
The EXP of the variable is: 22026.5
(1 row(s) affected)
B.B. 指数と自然対数を計算するFinding exponentials and natural logarithms
次の例では、20
の自然対数の指数値と、20
の指数の自然対数を返します。The following example returns the exponential value of the natural logarithm of 20
and the natural logarithm of the exponential of 20
. これらの関数は互いの逆関数なので、どちらの場合も戻り値は 20
です。Because these functions are inverse functions of one another, the return value in both cases is 20
.
SELECT EXP(LOG(20)), LOG(EXP(20))
GO
結果セットは次のようになります。Here is the result set.
---------------------- ----------------------
20 20
(1 row(s) affected)
例: Azure Synapse AnalyticsAzure Synapse Analytics、Parallel Data WarehouseParallel Data WarehouseExamples: Azure Synapse AnalyticsAzure Synapse Analytics and Parallel Data WarehouseParallel Data Warehouse
C.C. 数値の指数を計算するFinding the exponent of a number
次の例では、指定された値 (10
) の指数値を返します。The following example returns the exponential value of the specified value (10
).
SELECT EXP(10);
結果セットは次のようになります。Here is the result set.
----------
22026.4657948067
D.D. 指数値と自然対数を計算するFinding exponential values and natural logarithms
次の例では、20
の自然対数の指数値と、20
の指数の自然対数を返します。The following example returns the exponential value of the natural logarithm of 20
and the natural logarithm of the exponential of 20
. これらの関数は互いの逆関数なので、どちらの場合も戻り値は 20
です。Because these functions are inverse functions of one another, the return value in both cases is 20
.
SELECT EXP( LOG(20)), LOG( EXP(20));
結果セットは次のようになります。Here is the result set.
-------------- -----------------
20 20
関連項目See Also
数学関数 (Transact-SQL) Mathematical Functions (Transact-SQL)
LOG (Transact-SQL) LOG (Transact-SQL)
LOG10 (Transact-SQL)LOG10 (Transact-SQL)