#213 gcfactor gives internal error FIX

closed
nobody
Lisp Core (471)
5
2006-07-02
2003-01-15
No

In Maxima 5.5, Windows 2000

gcfactor(5) => Error: (0 1) is not of type NUMBER.
Also
gcfactor(1) => false

The problem is in the function $gcfactor (numth.lisp).

Here is corrected code.

(DEFMFUN $gcfactor (n)
(setq n (cdr ($totaldisrep ($bothcoef ($rat n '$%i) '$%i))))
(if (not (and (integerp (car n)) (integerp (cadr n))))
(gcdisp (nreverse n))
(do ((factors (gcfactor (cadr n) (car n)) (cddr factors))
(res nil))
((null factors)
(cond ((null res) 1)
((null (cdr res)) (car res))
(t (cons '(mtimes simp) (nreverse res)))))
(let ((term (car factors))
(exp (cadr factors)))
(push
(if (= exp 1)
(gcdisp term)
(pow (gcdisp term) exp))
res)))))

As before, this still gives an internal error for things like
gcfactor(4/(%i+1)).

Discussion

  • Robert Dodier

    Robert Dodier - 2006-07-02

    Logged In: YES
    user_id=501686

    Not observed in 5.9.3cvs. CVS log for src/numth.lisp
    indicates patch suggested in this report was applied in
    r1.2. Closing this report as fixed.

     
  • Robert Dodier

    Robert Dodier - 2006-07-02
    • status: open --> closed
    • labels: --> Lisp Core
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks