From 6d40cfd77f1d2f1e1403e4b41c0b53ae6499ea11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 27 Jun 2016 12:54:04 +0200 Subject: Add math:floor/1 and math:ceil/1 Add math:floor/1 and math:ceil/1 to avoid unnecessary conversions in floating point expressions. That is, instead of having to write float(floor(X)) as part of a floating point expressions, we can write simply math:floor(X). --- lib/compiler/test/float_SUITE.erl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/compiler/test') diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl index f6095947ca..0ebc71eb9b 100644 --- a/lib/compiler/test/float_SUITE.erl +++ b/lib/compiler/test/float_SUITE.erl @@ -150,6 +150,11 @@ math_functions(Config) when is_list(Config) -> ?OPTIONAL(0.0, math:erf(id(0))), ?OPTIONAL(1.0, math:erfc(id(0))), + 5.0 = math:floor(5.6), + 6.0 = math:ceil(5.6), + 5.0 = math:floor(id(5.4)), + 6.0 = math:ceil(id(5.4)), + %% Only for coverage (of beam_type.erl). {'EXIT',{undef,_}} = (catch math:fnurfla(0)), {'EXIT',{undef,_}} = (catch math:fnurfla(0, 0)), -- cgit v1.2.3