PLSQL | LN Function Last Updated : 01 Nov, 2019 Comments Improve Suggest changes Like Article Like Report 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. Syntax: LN(number) Parameters Used: 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. Return Value: 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: Example-1: DECLARE Test_Number number := 20; BEGIN dbms_output.put_line(LN(Test_Number number)); END; Output: 2.99573227355399 In the above example, 20 is the numeric value whose natural logarithm value is 2.99573227355399 Example-2: DECLARE Test_Number number := 25; BEGIN dbms_output.put_line(LN(Test_Number number)); END; Output: 3.2188758248682 In the above example, 25 is the numeric value whose natural logarithm value is 3.2188758248682 Example-3: DECLARE Test_Number number := 100.5; BEGIN dbms_output.put_line(LN(Test_Number number)); END; Output: 4.61015772749913 In the above example, 100.5 is the numeric value whose natural logarithm value is 4.61015772749913 Advantage: This function is used to find out the natural logarithm of a given input number. Comment More infoAdvertise with us Next Article PLSQL | LN Function K Kanchan_Ray Follow Improve Article Tags : SQL SQL-PL/SQL Similar Reads PLSQL | LOG Function The PLSQL LOG function is used for returning the logarithm of n base m. The LOG function accepts two parameters which are used to calculate the logarithmic value. The LOG function returns a value of the numeric data type. This function takes as an argument any numeric data type as well as any non-nu 2 min read PLSQL | LPAD Function The PLSQL LPAD function is used for padding the left-side of a string with a specific set of characters. a prerequisite for this is that string shouldn't be NULL. The LPAD function in PLSQL is useful for formatting the output of a query. The LPAD function accepts three parameters which are input_str 2 min read PLSQL | NCHR Function The PLSQL NCHR function is used for returning the character based on the number code in the national character set or in other words it returns the binary equivalent to the number in the national character set. The value returned by the NCHR function is always of the datatype NVARCHAR2. The NCHR fun 1 min read PLSQL | LENGTH Function The PLSQL LENGTH function is used for returning the length of the specified string, in other words, it returns the length of char. The char accepted by the LENGTH function in PLSQL can be of any of the datatypes such as CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The value returned by the LENG 1 min read PLSQL | LENGTH2 Function The PLSQL LENGTH2 function is used for returning the length of the specified string, in other words, it returns the length of char. UCS-2 codepoints is a character encoding standard in which characters are represented by a fixed-length 16 bits (2 bytes). UCS-2 represents a possible maximum of 65, 53 2 min read PLSQL | LENGTHB Function The PLSQL LENGTHB function is used for returning the length of the specified string using bytes instead of characters. The char accepted by the LENGTHB function in PLSQL can be of any of the datatypes such as CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The value returned by the LENGTHB functio 1 min read PLSQL | LENGTH4 Function The PLSQL LENGTH4 function is used for returning the length of the specified string, using UCS4 code points. UCS-4 codepoints is a character encoding which allows the representation of each value as exactly four bytes (one 32-bit word). UCS-4 represents a possible value between 0 and hexadecimal 7FF 2 min read PLSQL | LENGTHC Function The PLSQL LENGTHC function is used for returning the length of the specified string using UNICODE complete characters. The char accepted by the LENGTHC function in PLSQL can be of any of the datatypes such as CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The value returned by the LENGTHC functio 1 min read PLSQL | LEAST Function The LEAST is an inbuilt function in PLSQL which is used to return the least value from a given list of some expressions. These expressions may be numbers, alphabets etc. Syntax: LEAST(exp1, exp2, ... exp_n) Parameters Used: This function accept some parameters like exp1, exp2, ... exp_n. These each 2 min read PLSQL | MOD Function The MOD function is an inbuilt function in PLSQL which is used to return the remainder when a is divided by b. Its formula is m - n * \left\lfloor\dfrac{m}{n}\right\rfloor. Syntax: MOD(a, b) Parameters Used: This function accepts two parameters a and b. This function gives remainder as the output wh 2 min read Like