Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

c

What is logl in C?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The logl function calculates the natural logarithm (logelog_e or lnln) 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, ln numberln \space number 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 double
return 0;
}

RELATED TAGS

c

CONTRIBUTOR

Behzad Ahmad
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring