The LN function is an inbuilt function in PLSQL which is used to return the natural logarithm of a given input number. The natural logarithm of a number is the logarithm of that number to the base e, where e is the mathematical constant approximately equal to 2.718. This is written using the notation lnx and also some time as logex.
This function accept a parameter number which is the numeric value used to calculate the natural logarithm. This number should must be greater than 0.
This function returns the natural logarithm of a given input numeric value.
Supported Versions of Oracle/PLSQL:
- Oracle 12c
- Oracle 11g
- Oracle 10g
- Oracle 9i
- Oracle 8i
Let’s see some examples which illustrate the LN function:
DECLARE Test_Number number := 20; BEGIN dbms_output.put_line(LN(Test_Number number)); END;
In the above example, 20 is the numeric value whose natural logarithm value is 2.99573227355399
DECLARE Test_Number number := 25; BEGIN dbms_output.put_line(LN(Test_Number number)); END;
In the above example, 25 is the numeric value whose natural logarithm value is 3.2188758248682
DECLARE Test_Number number := 100.5; BEGIN dbms_output.put_line(LN(Test_Number number)); END;
In the above example, 100.5 is the numeric value whose natural logarithm value is 4.61015772749913
This function is used to find out the natural logarithm of a given input number.
- PLSQL | MOD Function
- PLSQL | EXP Function
- PLSQL | LEAST Function
- PLSQL | TAN Function
- PLSQL | ABS Function
- PLSQL | LOG Function
- PLSQL | CHR Function
- PLSQL | COS Function
- PLSQL | SIN Function
- PLSQL | SQRT Function
- PLSQL | POWER Function
- PLSQL | REMAINDER Function
- PLSQL | INSTRB Function
- PLSQL | CURRENT_DATE Function
- PLSQL | ADD_MONTHS Function
- PLSQL | LENGTH Function
- PLSQL | CURRENT_TIMESTAMP Function
- PLSQL | SUBSTR Function
- PLSQL | ATAN Function
- PLSQL | SINH Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.