aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorMarcus Arendt <[email protected]>2015-01-16 14:36:05 +0100
committerMarcus Arendt <[email protected]>2015-01-16 14:36:05 +0100
commit905824012cef106e7bd3796bff36a2aa04b58850 (patch)
tree6805bd7570965965e29c89e6673095bbd26599e1 /lib/stdlib
parente52e4398a318293d57485c0a47f9c8e50a4b2b4b (diff)
parentfdf09e81de5e7f1ecfe71f98b56c411073badae8 (diff)
downloadotp-905824012cef106e7bd3796bff36a2aa04b58850.tar.gz
otp-905824012cef106e7bd3796bff36a2aa04b58850.tar.bz2
otp-905824012cef106e7bd3796bff36a2aa04b58850.zip
Merge branch 'oliv3/math_log2/OTP-12411'
* oliv3/math_log2/OTP-12411: Add math:log2/1
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/doc/src/math.xml1
-rw-r--r--lib/stdlib/src/math.erl7
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/stdlib/doc/src/math.xml b/lib/stdlib/doc/src/math.xml
index 43cd20e726..7cfc8a1175 100644
--- a/lib/stdlib/doc/src/math.xml
+++ b/lib/stdlib/doc/src/math.xml
@@ -67,6 +67,7 @@
<name name="atanh" arity="1"/>
<name name="exp" arity="1"/>
<name name="log" arity="1"/>
+ <name name="log2" arity="1"/>
<name name="log10" arity="1"/>
<name name="pow" arity="2"/>
<name name="sqrt" arity="1"/>
diff --git a/lib/stdlib/src/math.erl b/lib/stdlib/src/math.erl
index 98a70b1644..43f736e54c 100644
--- a/lib/stdlib/src/math.erl
+++ b/lib/stdlib/src/math.erl
@@ -24,7 +24,7 @@
-export([sin/1, cos/1, tan/1, asin/1, acos/1, atan/1, atan2/2, sinh/1,
cosh/1, tanh/1, asinh/1, acosh/1, atanh/1, exp/1, log/1,
- log10/1, pow/2, sqrt/1, erf/1, erfc/1]).
+ log2/1, log10/1, pow/2, sqrt/1, erf/1, erfc/1]).
-spec acos(X) -> float() when
X :: number().
@@ -92,6 +92,11 @@ exp(_) ->
log(_) ->
erlang:nif_error(undef).
+-spec log2(X) -> float() when
+ X :: number().
+log2(_) ->
+ erlang:nif_error(undef).
+
-spec log10(X) -> float() when
X :: number().
log10(_) ->