Menu

#4669 non numeric value for factlim

None
closed
nobody
None
5
4 days ago
2026-02-06
No

The option variable factlim should require that it be assigned to a real numeric value; otherwise

(%i1) factlim : larry$

(%i2) double_factorial(6);
Maxima encountered a Lisp error:

 The value $LARRY is not of the expected type REAL.

Discussion

  • Raymond Toy

    Raymond Toy - 2026-02-07

    The docstring says it should be an integer. And it also says -1 means all integers are expanded. So should it really accept any real number?

    I did notice that factlim:3.0 works (with HEAD), but then double_factorial(6) returns 48.00000...1. But with the default factlim value of 100000, double_factorial returns 48. Not sure what's going with that, but that's probably a different issue from this one.

    Easy enough to add a :setting-predicate for factlim to make sure it's a real (or integer) so that it only accepts numbers.

     
  • Raymond Toy

    Raymond Toy - 2026-02-11

    See the branch issue-4669-numeric-value-for-factlim for a fix. Only integer values (positive or negative) are accepted now.

    double_factorial appears not to be documented, but !! is. Also, with factlim:3, double_factorial(6) returns 48.00000000000001 but 6!! returns 48. Are they not the same functions, just with different names?

     
  • Raymond Toy

    Raymond Toy - 4 days ago
    • status: open --> closed
     
  • Raymond Toy

    Raymond Toy - 4 days ago

    Merged issue-4669-numeric-value-for-factlim, which enforces factlim to be any integer value. See commit [64ff7d]

     

    Related

    Commit: [64ff7d]


Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →