aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorGuilherme Andrade <[email protected]>2016-10-25 22:48:26 +0100
committerGuilherme Andrade <[email protected]>2016-11-02 18:55:29 +0000
commit39d08368a04aa0459390ac070f3570e10cffe219 (patch)
treecebf90a75a6a12610618b73748fe6103539d8420 /lib/compiler/test
parent3137cabe8ac09841fcaa4786fd7da8fc7caf621b (diff)
downloadotp-39d08368a04aa0459390ac070f3570e10cffe219.tar.gz
otp-39d08368a04aa0459390ac070f3570e10cffe219.tar.bz2
otp-39d08368a04aa0459390ac070f3570e10cffe219.zip
Add test cases for math:fmod/2 BIF
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/float_SUITE.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl
index 0ebc71eb9b..08c3dd8593 100644
--- a/lib/compiler/test/float_SUITE.erl
+++ b/lib/compiler/test/float_SUITE.erl
@@ -155,6 +155,13 @@ math_functions(Config) when is_list(Config) ->
5.0 = math:floor(id(5.4)),
6.0 = math:ceil(id(5.4)),
+ 0.0 = math:fmod(42, 42),
+ 0.25 = math:fmod(1, 0.75),
+ -1.0 = math:fmod(-4.0, 1.5),
+ -0.375 = math:fmod(-3.0, -0.875),
+ 0.125 = math:fmod(8.125, -4),
+ {'EXIT',{badarith,_}} = (catch math:fmod(5.0, 0.0)),
+
%% Only for coverage (of beam_type.erl).
{'EXIT',{undef,_}} = (catch math:fnurfla(0)),
{'EXIT',{undef,_}} = (catch math:fnurfla(0, 0)),