Menu

#438 rat/tellrat/modulus:2 can return -1 on GCL (SBCL OK)

None
open
nobody
5
2021-07-03
2003-11-05
No
algebraic:true$ modulus:2$
tellrat(a^2+a)$

rat(a^2) => - a

With modulus=2, -1 is supposed to simplify to 1.

This can be fixed (bizarrely) by ev:

ev(%) => a

Discussion

  • Wolfgang Jenkner

    Logged In: YES
    user_id=581700

    On both SBCL and CLISP I get the expected result

    (C4) rat(a^2);
    (D4)/R/ a

    I'd guess this is the same GCL specific misfeature as #706562
    (mod(-2,4) => -2 not 2).

     
  • Robert Dodier

    Robert Dodier - 2006-07-13

    Logged In: YES
    user_id=501686

    Observed w/ 5.9.3cvs / gcl 2.6.7, but not 5.9.3cvs / sbcl
    0.9.9 or clisp 2.38.

     
  • Robert Dodier

    Robert Dodier - 2006-07-13
    • labels: --> 460522
     
  • Robert Dodier

    Robert Dodier - 2006-09-09
    • labels: 460522 --> Lisp Core - Polynomials
     
  • Robert Dodier

    Robert Dodier - 2021-07-02

    Referred-to ticket #706562 is presumably https://sourceforge.net/p/maxima/bugs/264/ (due to system-wide renumbering several years ago). #264 is reported to be fixed so maybe this bug just needs to be retested.

     
  • Robert Dodier

    Robert Dodier - 2021-07-03

    Retested w/ not-too-old Maxima + GCL and bug is still present.

    (%i3) algebraic:true$ modulus:2$
    
    (%i5) tellrat(a^2+a)$
    
    (%i6) 
    rat(a^2);
    (%o6)/R/                              - a
    (%i7) ev(%);
    (%o7)/R/                               a
    
    Maxima version: "branch_5_44_base_181_geeb4b055f_dirty"
    Maxima build date: "2020-12-08 08:54:55"
    Host type: "i686-pc-linux-gnu"
    Lisp implementation type: "GNU Common Lisp (GCL)"
    Lisp implementation version: "GCL 2.6.12"
    User dir: "/home/robert/.maxima"
    Temp dir: "/tmp"
    Object dir: "/home/robert/.maxima/binary/branch_5_44_base_181_geeb4b055f_dirty/gcl/GCL_2_6_12"
    Frontend: false
    
     
  • Stavros Macrakis

    • summary: rat/tellrat/modulus:2 can return -1 --> rat/tellrat/modulus:2 can return -1 on GCL (SBCL OK)
     

Log in to post a comment.