mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Fix logand range analysis.
* module/language/cps/types.scm (logand): Fix range analysis.
This commit is contained in:
parent
42b544ebbc
commit
74fe7fae00
1 changed files with 4 additions and 4 deletions
|
@ -991,13 +991,13 @@ minimum, and maximum."
|
|||
(define-simple-type-checker (logand &exact-integer &exact-integer))
|
||||
(define-type-inferrer (logand a b result)
|
||||
(define (logand-min a b)
|
||||
(if (< a b 0)
|
||||
(if (and (negative? a) (negative? b))
|
||||
(min a b)
|
||||
0))
|
||||
(define (logand-max a b)
|
||||
(if (< a b 0)
|
||||
0
|
||||
(max a b)))
|
||||
(if (and (positive? a) (positive? b))
|
||||
(min a b)
|
||||
0))
|
||||
(restrict! a &exact-integer -inf.0 +inf.0)
|
||||
(restrict! b &exact-integer -inf.0 +inf.0)
|
||||
(define! result &exact-integer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue