diff options
author | Björn Gustavsson <[email protected]> | 2016-06-27 12:54:04 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-05 11:49:13 +0200 |
commit | 6d40cfd77f1d2f1e1403e4b41c0b53ae6499ea11 (patch) | |
tree | 774f51ba146c2b172b73bf778c6d8e820d0a0d9c /lib/compiler/src/beam_type.erl | |
parent | 986d32a62b20c32338dac4dfd27c141c8f9be0fe (diff) | |
download | otp-6d40cfd77f1d2f1e1403e4b41c0b53ae6499ea11.tar.gz otp-6d40cfd77f1d2f1e1403e4b41c0b53ae6499ea11.tar.bz2 otp-6d40cfd77f1d2f1e1403e4b41c0b53ae6499ea11.zip |
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).
Diffstat (limited to 'lib/compiler/src/beam_type.erl')
-rw-r--r-- | lib/compiler/src/beam_type.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl index acaf3ede66..b4776294be 100644 --- a/lib/compiler/src/beam_type.erl +++ b/lib/compiler/src/beam_type.erl @@ -592,6 +592,8 @@ is_math_bif(log10, 1) -> true; is_math_bif(sqrt, 1) -> true; is_math_bif(atan2, 2) -> true; is_math_bif(pow, 2) -> true; +is_math_bif(ceil, 1) -> true; +is_math_bif(floor, 1) -> true; is_math_bif(pi, 0) -> true; is_math_bif(_, _) -> false. |