diff options
author | Björn Gustavsson <[email protected]> | 2016-06-20 13:25:04 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-05 11:49:13 +0200 |
commit | 986d32a62b20c32338dac4dfd27c141c8f9be0fe (patch) | |
tree | 8c913024f55a7aec281c3f72f630f6aaf52b8bae /lib/compiler/src/beam_validator.erl | |
parent | 5dba22121d77237edae5cf805b9da5f7e056e532 (diff) | |
download | otp-986d32a62b20c32338dac4dfd27c141c8f9be0fe.tar.gz otp-986d32a62b20c32338dac4dfd27c141c8f9be0fe.tar.bz2 otp-986d32a62b20c32338dac4dfd27c141c8f9be0fe.zip |
Implement the new ceil/1 and floor/1 guard BIFs
Implement as ceil/1 and floor/1 as new guard BIFs (essentially part of
Erlang language). They are guard BIFs because trunc/1 is a guard
BIF. It would be strange to have trunc/1 as a part of the language, but
not ceil/1 and floor/1.
Diffstat (limited to 'lib/compiler/src/beam_validator.erl')
-rw-r--r-- | lib/compiler/src/beam_validator.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index 4c0cb6780a..fd340bdabc 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,[]}; |