From: Rupert S. <rsw...@us...> - 2013-02-06 14:26:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via be937515f80f4049929a600f79533bf5a9f28c4a (commit) from 1a85b3ff4ab5faf29cbf5a84f8082bf9ad087e72 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit be937515f80f4049929a600f79533bf5a9f28c4a Author: Rupert Swarbrick <rsw...@gm...> Date: Wed Jan 2 21:58:24 2013 +0000 Fix for #2528 (imagpart etc. wrong when var declared real and complex) o Fix in RISPLIT, to check DECL-REALP if a symbol is DECL-COMPLEXP o Add test for behaviour in rtest16.mac diff --git a/src/rpart.lisp b/src/rpart.lisp index 29fa364..82b9ba4 100644 --- a/src/rpart.lisp +++ b/src/rpart.lisp @@ -365,9 +365,12 @@ (defun risplit (l) (let (($domain '$complex) ($m1pbranch t) $logarc op) (cond ((atom l) + ;; Symbols are assumed to represent real values, unless they have + ;; been declared to be complex. If they have been declared to be both + ;; real and complex, they are taken to be real. (cond ((eq l '$%i) (cons 0 1)) ((eq l '$infinity) (cons '$und '$und)) - ((decl-complexp l) (risplit-noun l)) + ((and (decl-complexp l) (not (decl-realp l))) (risplit-noun l)) (t (cons l 0)))) ((eq (caar l) 'rat) (cons l 0)) ((eq (caar l) 'mplus) (risplit-mplus l)) diff --git a/tests/rtest16.mac b/tests/rtest16.mac index df3fdf5..337a61a 100644 --- a/tests/rtest16.mac +++ b/tests/rtest16.mac @@ -2361,3 +2361,15 @@ realpart(log(-1b0)); */ errcatch(elliptic_f(2,1)); []; + +/* + * Bug 2528: A variable should be real if it is both real and complex + */ +(declare(foo, real), declare(foo, complex), 0); +0$ + +[realpart(foo), imagpart(foo)]; +[foo, 0]$ + +(kill(foo), 0); +0$ ----------------------------------------------------------------------- Summary of changes: src/rpart.lisp | 5 ++++- tests/rtest16.mac | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletions(-) hooks/post-receive -- Maxima CAS |