From e21a6c9ec713219b0aa2b2a4224f97e713d7337f Mon Sep 17 00:00:00 2001 From: Guilherme Andrade Date: Tue, 25 Oct 2016 22:05:10 +0100 Subject: Add math:fmod/2 BIF Returns the (floating point) remainder of first argument divided by second argument. --- lib/stdlib/doc/src/math.xml | 1 + lib/stdlib/src/math.erl | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/stdlib') diff --git a/lib/stdlib/doc/src/math.xml b/lib/stdlib/doc/src/math.xml index 70ca6ae78e..b4f096217a 100644 --- a/lib/stdlib/doc/src/math.xml +++ b/lib/stdlib/doc/src/math.xml @@ -62,6 +62,7 @@ + diff --git a/lib/stdlib/src/math.erl b/lib/stdlib/src/math.erl index 1db48cd0a2..3a3b384d8f 100644 --- a/lib/stdlib/src/math.erl +++ b/lib/stdlib/src/math.erl @@ -26,7 +26,8 @@ -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, log2/1, log10/1, pow/2, sqrt/1, erf/1, erfc/1, - ceil/1, floor/1]). + ceil/1, floor/1, + fmod/2]). -spec acos(X) -> float() when X :: number(). @@ -99,6 +100,11 @@ exp(_) -> floor(_) -> erlang:nif_error(undef). +-spec fmod(X, Y) -> float() when + X :: number(), Y :: number(). +fmod(_, _) -> + erlang:nif_error(undef). + -spec log(X) -> float() when X :: number(). log(_) -> -- cgit v1.2.3