Function: calcFunc-lsh

calcFunc-lsh is an autoloaded and byte-compiled function defined in calc-bin.el.gz.

Signature

(calcFunc-lsh A &optional N W)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-bin.el.gz
(defun calcFunc-lsh (a &optional n w)   ; [I I] [Public]
  (setq a (math-trunc a)
	n (if n (math-trunc n) 1))
  (if (eq (car-safe a) 'mod)
      (math-binary-modulo-args 'calcFunc-lsh a n w)
    (setq w (if w (math-trunc w) calc-word-size))
    (or (integerp w)
	(math-reject-arg w 'fixnump))
    (or (Math-integerp a)
	(math-reject-arg a 'integerp))
    (or (Math-integerp n)
	(math-reject-arg n 'integerp))
    (if (< w 0)
	(math-clip (calcFunc-lsh a n (- w)) w)
      (if (Math-integer-negp a)
	  (setq a (math-clip a w)))
      (cond ((and (or (Math-lessp n (- w))
		      (Math-lessp w n))
                  (not (zerop w)))
	     0)
	    ((< n 0)
	     (ash (math-clip a w) n))
	    (t
	     (math-clip (math-mul a (math-power-of-2 n)) w))))))