bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

secant:find-root correct stop (was Re: secant:root-find stop wrong numbe


From: Larry Evans
Subject: secant:find-root correct stop (was Re: secant:root-find stop wrong number args
Date: Mon, 10 Jul 2006 06:50:54 -0500
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

On 07/09/2006 07:54 PM, Larry Evans wrote:
address@hidden:~/prog_dev/gnucash/tests$ guile
guile> (define (myfun x)x)
guile> (myfun 2.0)
2.0
guile> (use-modules (ice-9 slib))
guile> (require 'root)
guile> (secant:find-root myfun -100.0 100.0 -3)
ERROR: Wrong number of arguments to #<procedure stop? (x0 x1 fmax count)>
ABORT: (wrong-number-of-args)
guile> (version)
"1.6.7"
guile> address@hidden:~/prog_dev/gnucash/tests$

Is there a fix for this somewhere?
Adding a extra formal arg to stop? works for my test:

  (letrec ((stop?
            (cond ((procedure? prec) prec)
                  ((and (integer? prec) (negative? prec))
                   (lambda (x0 x1 fmax count ignore)
                                           ;;^^^^^^ extra arg
                     (>= count (- prec))))
                  (else
                   (lambda (x0 f0 x1 f1 count)
                     (and (< (abs f0) prec)
                          (< (abs f1) prec))))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]