What is logl in C?
The logl function calculates the natural logarithm ( or ) of the argument passed, when the argument is of the long double type.
Standard Library
#include<math.h>
Syntax
long double logl( long double number );
Parameters
number: A long double value.
Return Value
If no errors occur, is returned.
If a negative number is passed as an argument, an error occurs.
Code
#include <math.h>#include <stdio.h>int main(){long double result;long double number;number = 10.2;result = logl(number);printf("The natural log of %Lf is %Lf\n", number, result); // %Lf is the string formatter for long doublereturn 0;}
Free Resources
Copyright ©2026 Educative, Inc. All rights reserved