#226 binomial

closed
nobody
Lisp Core (471)
5
2006-07-04
2003-02-13
No

The binomial function (defined in mlisp.lisp) sets $float
and $numer to true. This can cause $binomial
to return a decimal approximation when a rational
is expected; consider

------ file bug.lisp--------------------------------

(defun $unk (a b)
($binomial a b))
--------------------------------------------------------

(C1) load("l:/maxima-bugs/bug.lisp")$

(C2) unk(21/5,4);
(D2) 1.4784
(C3) display2d : false$

(C4) binomial(21/5,4);
(D4) 924/625

Calling binomial from a Maxima function doesn't
use the binomial function defined in mlisp; for
example,

(C5) foo(a,b) := block([], binomial(a,b))$
(C6) foo(21/5,4);
(D6) 924/625

I seen no reason for $binomial in mlisp to set $float
or $numer to true; I suggest that we try removing
these assigments.

Barton

Discussion

  • Stavros Macrakis

    Logged In: YES
    user_id=588346

    The $binomial function in mlisp is part of the noun/verb
    scheme. Along the same lines, ($sin '$%pi) => 1.22E-16 and
    not 0.

     
  • Robert Dodier

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

    Robert Dodier - 2006-07-04

    Logged In: YES
    user_id=501686

    $BINOMIAL appears to be working as intended per the comment
    by Stavros. Closing this report as "won't fix".

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks