LN
Purpose
Computes the natural logarithm of the argument.
Syntax
where:
Syntax element … |
Specifies … |
arg |
a nonzero, positive numeric argument. |
ANSI Compliance
This is a Teradata extension to the ANSI SQL:2011 standard.
Result Type and Attributes
The data type, format, and title for LN(arg) are as follows.
Data Type |
Format |
Title |
FLOAT |
Default format for FLOAT |
LN(arg) |
For information on default data type formats, see SQL Data Types and Literals.
Argument Types and Rules
If arg is not FLOAT, it is converted to FLOAT based on implicit type conversion rules. If the argument cannot be converted, an error is reported. For more information on implicit type conversion, see “Implicit Type Conversions” on page 583.
If arg is a UDT, the following rules apply:
To define an implicit cast for a UDT, use the CREATE CAST statement and specify the AS ASSIGNMENT clause. For more information on CREATE CAST, see SQL Data Definition Language.
LN cannot be applied to the following types of arguments:
Examples
Representative LN arithmetic function expressions and the results are as follows.
Expression |
Result |
LN(2.71828182845905) |
1.00000000000000E+000 |
LN(0) |
Error |