Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

log(3) [freebsd man page]

LOG(3)							   BSD Library Functions Manual 						    LOG(3)

NAME
log, logf, logl, log10, log10f, log10l, log2, log2f, log2l, log1p, log1pf, log1pl -- logarithm functions LIBRARY
Math Library (libm, -lm) SYNOPSIS
#include <math.h> double log(double x); float logf(float x); long double logl(long double x); double log10(double x); float log10f(float x); long double log10l(long double x); double log2(double x); float log2f(float x); long double log2l(long double x); double log1p(double x); float log1pf(float x); long double log1pl(long double x); DESCRIPTION
The log(), logf(), and logl() functions compute the natural logarithm of x. The log10(), log10f(), and log10l() functions compute the logarithm base 10 of x, while log2(), log2f(), and log2l() compute the logarithm base 2 of x. The log1p(), log1pf(), and log1pl() functions compute the natural logarithm of 1 + x. Computing the natural logarithm as log1p(x) is more accurate than computing it as log(1 + x) when x is close to zero. RETURN VALUES
These functions return the requested logarithm; the logarithm of 1 is +0. An attempt to take the logarithm of +-0 results in a divide-by- zero exception, and -infinity is returned. Otherwise, attempting to take the logarithm of a negative number results in an invalid exception and a return value of NaN. SEE ALSO
exp(3), ilogb(3), math(3), pow(3) STANDARDS
The log(), logf(), logl(), log10(), log10f(), log10l(), log2(), log2f(), log2l(), log1p(), log1pf(), and log1pl() functions conform to ISO/IEC 9899:1999 (``ISO C99''). BSD
June 3, 2013 BSD

Check Out this Related Man Page

LOG(3)							   BSD Library Functions Manual 						    LOG(3)

NAME
log, logf, logl, log10, log10f, log10l, log2, log2f, log2l, log1p, log1pf, log1pl -- logarithm functions LIBRARY
Math Library (libm, -lm) SYNOPSIS
#include <math.h> double log(double x); float logf(float x); long double logl(long double x); double log10(double x); float log10f(float x); long double log10l(long double x); double log2(double x); float log2f(float x); long double log2l(long double x); double log1p(double x); float log1pf(float x); long double log1pl(long double x); DESCRIPTION
The log(), logf(), and logl() functions compute the natural logarithm of x. The log10(), log10f(), and log10l() functions compute the logarithm base 10 of x, while log2(), log2f(), and log2l() compute the logarithm base 2 of x. The log1p(), log1pf(), and log1pl() functions compute the natural logarithm of 1 + x. Computing the natural logarithm as log1p(x) is more accurate than computing it as log(1 + x) when x is close to zero. RETURN VALUES
These functions return the requested logarithm; the logarithm of 1 is +0. An attempt to take the logarithm of +-0 results in a divide-by- zero exception, and -infinity is returned. Otherwise, attempting to take the logarithm of a negative number results in an invalid exception and a return value of NaN. SEE ALSO
exp(3), ilogb(3), math(3), pow(3) STANDARDS
The log(), logf(), logl(), log10(), log10f(), log10l(), log2(), log2f(), log2l(), log1p(), log1pf(), and log1pl() functions conform to ISO/IEC 9899:1999 (``ISO C99''). BSD
June 3, 2013 BSD
Man Page

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

logarithm

Hi Guys, Is it possible to do Logarithm of a number in Unix?? i dunno how to handl logarithm operation (4 Replies)
Discussion started by: ROOZ
4 Replies

2. Shell Programming and Scripting

Binary logarithm

Hi all, I wonder how I can use binary logarithm in Solaris shell. I'm aware of the natural logarithm as discussed on the following post: https://www.unix.com/shell-programming-scripting/68175-logarithm.html Do you have any idea ? Thanks in advanced, Yigal (4 Replies)
Discussion started by: ydekel
4 Replies

3. Shell Programming and Scripting

deleting double entries in a log file

Hi Folks, I have a apache log file that has double entries (however not all lines appear twice). How can I delete automatically the first line of a double entry? Your help is greatly appreciated. Thanks, Klaus Here is what the log file looks like 217.81.190.164 - - "GET... (7 Replies)
Discussion started by: opusforum
7 Replies

4. Shell Programming and Scripting

How to divide results into several pages?

Hi All, I am wondering if anyone can help me with this. I have a long list of results and I want to divide them into several pages. Any ideas of how to do this? I'm using perl languange. eg: Output file consist of 400 data then would like to divide it into 50 data per pages. any help on... (2 Replies)
Discussion started by: kate katherine
2 Replies

5. Programming

Symbol referencing errors

Undefined first referenced symbol in file logf /var/tmp//ccwztFsO.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status float exponC(float mean) { index1++;... (1 Reply)
Discussion started by: willji1234
1 Replies

6. UNIX for Beginners Questions & Answers

Logrotate exclude log file

Hi all ! I've an issue to exclude a log file from logrotate, I tried this below: /var/log/apache2/*.log { olddir /var/log/apache2/old missingok rotate 50 compress copytruncate notifempty create 644 root root } I tried also:... (0 Replies)
Discussion started by: Arnaudh78
0 Replies