diff options
author | Björn Gustavsson <[email protected]> | 2016-09-05 11:50:33 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-05 11:50:33 +0200 |
commit | 6150c222ec25cc4e8aba80985017c5b7120bc454 (patch) | |
tree | 9c149f8d7b3d6c8135fcfe0b73b3dae8d88800d7 /lib/compiler/src/beam_validator.erl | |
parent | b501396623e80a798fba94a428646461aabe6796 (diff) | |
parent | 6d40cfd77f1d2f1e1403e4b41c0b53ae6499ea11 (diff) | |
download | otp-6150c222ec25cc4e8aba80985017c5b7120bc454.tar.gz otp-6150c222ec25cc4e8aba80985017c5b7120bc454.tar.bz2 otp-6150c222ec25cc4e8aba80985017c5b7120bc454.zip |
Merge branch 'bjorn/floor-ceiling/OTP-13692'
* bjorn/floor-ceiling/OTP-13692:
Add math:floor/1 and math:ceil/1
Implement the new ceil/1 and floor/1 guard BIFs
Diffstat (limited to 'lib/compiler/src/beam_validator.erl')
-rw-r--r-- | lib/compiler/src/beam_validator.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index 4c0cb6780a..61aea57906 100644 --- a/lib/compiler/src/beam_validator.erl +++ b/lib/compiler/src/beam_validator.erl @@ -1506,7 +1506,9 @@ bif_type(abs, [Num], Vst) -> bif_type(float, _, _) -> {float,[]}; bif_type('/', _, _) -> {float,[]}; %% Integer operations. +bif_type(ceil, [_], _) -> {integer,[]}; bif_type('div', [_,_], _) -> {integer,[]}; +bif_type(floor, [_], _) -> {integer,[]}; bif_type('rem', [_,_], _) -> {integer,[]}; bif_type(length, [_], _) -> {integer,[]}; bif_type(size, [_], _) -> {integer,[]}; @@ -1640,6 +1642,8 @@ return_type_math(log10, 1) -> {float,[]}; return_type_math(sqrt, 1) -> {float,[]}; return_type_math(atan2, 2) -> {float,[]}; return_type_math(pow, 2) -> {float,[]}; +return_type_math(ceil, 1) -> {float,[]}; +return_type_math(floor, 1) -> {float,[]}; return_type_math(pi, 0) -> {float,[]}; return_type_math(F, A) when is_atom(F), is_integer(A), A >= 0 -> term. |