summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp-cstr.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/comp-cstr.el')
-rw-r--r--lisp/emacs-lisp/comp-cstr.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 89815f03b53..bd1e04fb0bb 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -859,6 +859,18 @@ Non memoized version of `comp-cstr-intersection-no-mem'."
(null (neg cstr))
(equal (typeset cstr) '(cons)))))
+(defun comp-cstr-= (dst old-dst src)
+ "Constraint DST being = SRC."
+ (with-comp-cstr-accessors
+ (comp-cstr-intersection dst old-dst src)
+ (cl-loop for v in (valset dst)
+ when (and (floatp v)
+ (= v (truncate v)))
+ do (push (cons (truncate v) (truncate v)) (range dst)))
+ (cl-loop for (l . h) in (range dst)
+ when (eql l h)
+ do (push (float l) (valset dst)))))
+
(defun comp-cstr-> (dst old-dst src)
"Constraint DST being > than SRC.
SRC can be either a comp-cstr or an integer."