forked from erlang/otp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance range analysis for the bor operator
Teach beam_bounds:bounds/3 to calculate a range for the `bor` operator for negative or partly unbounded arguments. For example: bor0(A) when is_integer(A), -10 =< A, A =< 10 -> %% Range for A is -10..10 A bor 1. % Range is '-inf'..11 bor1(A, B) when is_integer(A), A < 0, is_integer(B), B < 0 -> %% Range for A and B is '-inf'..-1 A bor B. % Range is '-inf'..-1 bor2(A, B) when is_integer(A), A >= 1, is_integer(B), B >= 10 -> %% Range for A is 1..'+inf'; range for B is 10..'+inf' A bor B. % Range is 10..'+inf'
- Loading branch information
Showing
2 changed files
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters