Function: math-compose-sum

math-compose-sum is a byte-compiled function defined in calccomp.el.gz.

Signature

(math-compose-sum A PREC)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calccomp.el.gz
(defun math-compose-sum (a prec)
  (and (memq (length a) '(3 5 6))
       (let* ((expr (math-compose-expr (nth 1 a) 185))
	      (var
	       (let ((calc-language 'flat))
                 (math-compose-expr (nth 2 a) 0)))
	      (low (and (nth 3 a)
                        (let ((calc-language 'flat))
                          (math-compose-expr (nth 3 a) 0))))
	      (high (and (nth 4 a)
                         (let ((calc-language 'flat))
                           (math-compose-vector (nthcdr 4 a) ", " 0))))
              (comp
	       (list 'horiz
	       (append (list 'vcent (if high 3 2))
		       (and high (list high))
		       '("---- "
			 "\\    "
			 " >   "
			 "/    "
			 "---- ")
		       (if low
			   (list (list 'horiz var " = " low))
			 (list var)))
	       (if (memq (car-safe (nth 1 a)) '(calcFunc-sum calcFunc-prod))
		   " " "")
	       expr)))
	 (if (memq prec '(180 201))
             (math--comp-round-bracket comp)
           comp))))