Function: calcFunc-vfloor

calcFunc-vfloor is an autoloaded and byte-compiled function defined in calc-vec.el.gz.

Signature

(calcFunc-vfloor A &optional ALWAYS-VEC)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-vec.el.gz
(defun calcFunc-vfloor (a &optional always-vec)
  (setq a (math-prepare-set a))
  (let ((vec (list 'vec)) (p a) (prev nil) b mask)
    (while (setq p (cdr p))
      (setq mask (nth 1 (car p))
	    a (nth 2 (car p))
	    b (nth 3 (car p)))
      (and (memq mask '(0 1))
	   (not (math-infinitep a))
	   (setq mask (logior mask 2))
	   (math-num-integerp a)
	   (setq a (math-add a 1)))
      (setq a (math-ceiling a))
      (and (memq mask '(0 2))
	   (not (math-infinitep b))
	   (setq mask (logior mask 1))
	   (math-num-integerp b)
	   (setq b (math-sub b 1)))
      (setq b (math-floor b))
      (if (and prev (Math-equal (math-sub a 1) (nth 3 prev)))
	  (setcar (nthcdr 3 prev) b)
	(or (Math-lessp b a)
	    (setq vec (cons (setq prev (list 'intv mask a b)) vec)))))
    (setq vec (nreverse vec))
    (math-clean-set vec always-vec)))