Menu

#4605 askinteger extremely weak

None
open
nobody
5
2025-10-09
2025-09-01
No

askinteger/featurep(...,integer) is very weak.

makelist(featurep(q,'integer),
   [(-1)^ii, ii*(ii+1)/2, sin(ii*%pi/2), ii+1/2, %pi*ii,
     sin(ii), log(ii), %e^ii, %i*%pi])
     => [false, false, false, false, false,
                false, false, false, false]
 ~~~

 ``askinteger`` is equally weak. 

This is OK:

(%i2) featurep(%i*%pi,'integer);
(%o2)                                false

Related

Bugs: #4605

Discussion

  • David Scherfgen

    David Scherfgen - 2025-09-03

    Maybe askinteger should check the imagpart of the expression and say "no" when it's certain to be non-zero.

     
    • Stavros Macrakis

      askinteger is extremely weak. With declare(ii,integer)$ ,

      it doesn't know that all of the following are always integer-valued:

      (-1)^ii

      ii*(ii+1)/2

      sin(ii*%pi/2)

      and that the following are never integer-valued:

      ii+1/2

      %pi*ii

      sin(ii)

      log(ii)

      %e^ii

      All of these seem much more likely to arise "in the wild" and be useful to
      users than the %i*%pi case. I have generalized
      https://sourceforge.net/p/maxima/bugs/4605/ to include them.

            -s
      

      On Wed, Sep 3, 2025 at 1:26 PM David Scherfgen via Maxima-bugs maxima-bugs@lists.sourceforge.net wrote:

      Maybe askinteger should check the imagpart of the expression and say "no"
      when it's certain to be non-zero.


      [bugs:#4605] https://sourceforge.net/p/maxima/bugs/4605/
      askinteger(%i
      %pi)*

      Status: open
      Group: None
      Created: Mon Sep 01, 2025 04:49 PM UTC by Barton Willis
      Last Updated: Mon Sep 01, 2025 04:49 PM UTC
      Owner: nobody

      Not wrong, but far from optimal

      (%i1) askinteger(%i*%pi);
      Is %i %pi an integer?

      no;
      (%o1) no

      This is OK:

      (%i2) featurep(%i*%pi,'integer);
      (%o2) false


      Sent from sourceforge.net because maxima-bugs@lists.sourceforge.net is
      subscribed to https://sourceforge.net/p/maxima/bugs/

      To unsubscribe from further messages, a project admin can change settings
      at https://sourceforge.net/p/maxima/admin/bugs/options. Or, if this is a
      mailing list, you can unsubscribe from the mailing list.


      Maxima-bugs mailing list
      Maxima-bugs@lists.sourceforge.net
      https://lists.sourceforge.net/lists/listinfo/maxima-bugs

       

      Related

      Bugs: #4605

  • Stavros Macrakis

    • summary: askinteger(%i*%pi) --> askinteger extremely weak
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,13 +1,18 @@
    -Not wrong, but far from optimal
    +``askinteger/featurep(...,integer)`` is very weak.
     ~~~
    -(%i1) askinteger(%i*%pi);
    -Is %i %pi an integer?
    -
    -no;
    -(%o1)                                 no
    +makelist(featurep(q,'integer),
    +   [(-1)^ii, ii*(ii+1)/2, sin(ii*%pi/2), ii+1/2, %pi*ii,
    +     sin(ii), log(ii), %e^ii, %i*%pi])
    +     => [false, false, false, false, false,
    +                false, false, false, false]
    + ~~~
    + 
    + ``askinteger`` is equally weak. 
    + 
     ~~~
     This is OK:
     ~~~
     (%i2) featurep(%i*%pi,'integer);
     (%o2)                                false
     ~~~
    +
    
     
  • Robert Dodier

    Robert Dodier - 2025-10-09
    • labels: --> askinteger, featurep
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.