Monday, 5 March 2012

Summary of Log Functions in C & C++


The following is a summary of logs functions in C and C++. <math.h> library in C, <cmath> in C++.

C++ overloads the functions for different data types.


In C

double exp(double)
float expf(float)
long double expl(long double)

In C++

double | float | long exp(double | float | long)


In C

double log(double)
float logf(float)
long double logl(long double)

In C++

double | float | long log(double | float | long)



In C

double log10(double)
float log10f(float)
long double log10l(long double)

In C++

double | float | long log10(double | float | long)



C11 / C+11 Standards

The most recent updates to the language standards introduce several new log functions. None are implemented in Visual C++ 2010.

Here’s the list.

exp2                raise 2 to the nth power
log 2                companion to exp2

expm1             is exp(n) – 1 with more precision
logm1              log(n+1) with more precision


No comments:

Post a Comment