-
WikiChip
WikiChip
-
Architectures
Popular x86
-
Intel
- Client
- Server
- Big Cores
- Small Cores
-
AMD
Popular ARM
-
ARM
- Server
- Big
- Little
-
Cavium
-
Samsung
-
-
Chips
Popular Families
-
Ampere
-
Apple
-
Cavium
-
HiSilicon
-
MediaTek
-
NXP
-
Qualcomm
-
Renesas
-
Samsung
-
From WikiChip
log10
Revision as of 23:32, 22 November 2015 by 109.236.84.27 (talk) (Created page with "'''log10''' is a function in many programming languages that returns the common logarithm of the input. == Implementation == Log base 10 can be calcu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
log10 is a function in many programming languages that returns the common logarithm of the input.
Implementation[edit]
Log base 10 can be calculated using the following formula.
An unoptimized implementation of log10 in C might look like:
#define LOG10 2.30258509299404568401799145468436421
double log10(double x)
{
if (x < 0)
{
errno = EDOM;
return -HUGE_VAL;
}
else if (x == 0)
{
errno = ERANGE;
return -HUGE_VAL;
}
return log(x) / LOG10;
}
Language support[edit]
Language | Function | Package/Module |
---|---|---|
C | log10 | math.h |
C++ | log10 | cmath |
Go | Log10 | math |
Haskell | - | |
Java | log10 | java.lang.Math |
Lisp | log10 | |
Lua | log10 | math |
mIRC | log10 | |
Pascal | - | |
Perl | - | |
PHP | log10 | |
Python | log10 | math |
Ruby | log10 | Math |
See also[edit]
Retrieved from "https://en.wikichip.org/w/index.php?title=log10&oldid=12679"