Mercurial > emacs
comparison lisp/calc/calcalg2.el @ 68304:0609d354823d
(calc-sum-rec): Fix the case where the lower limit is 0.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Sat, 21 Jan 2006 04:28:29 +0000 |
parents | 06892c426dff |
children | 6bf177f8065b 5b7d410e31f9 |
comparison
equal
deleted
inserted
replaced
68303:9d71640b5bb2 | 68304:0609d354823d |
---|---|
2010 (setq poly (math-poly-mix poly 1 | 2010 (setq poly (math-poly-mix poly 1 |
2011 (math-sum-integer-power n) (car t1)) | 2011 (math-sum-integer-power n) (car t1)) |
2012 n (1+ n) | 2012 n (1+ n) |
2013 t1 (cdr t1))) | 2013 t1 (cdr t1))) |
2014 (setq n (math-build-polynomial-expr poly high)) | 2014 (setq n (math-build-polynomial-expr poly high)) |
2015 (if (memq low '(0 1)) | 2015 (if (= low 1) |
2016 n | 2016 n |
2017 (math-sub n (math-build-polynomial-expr poly | 2017 (math-sub n (math-build-polynomial-expr poly |
2018 (math-sub low 1)))))) | 2018 (math-sub low 1)))))) |
2019 ((and (memq (car expr) '(+ -)) | 2019 ((and (memq (car expr) '(+ -)) |
2020 (setq t1 (math-sum-rec (nth 1 expr) var low high) | 2020 (setq t1 (math-sum-rec (nth 1 expr) var low high) |