#649 RANDOM with no argument fails

closed
nobody
5
2004-11-24
2004-11-21
No

describe(random) claims:

If no argument is given a random integer between
-2^(29) and 2^(29) -1 is returned.

but

(%i41) random();
Maxima encountered a Lisp error:

Invalid number of arguments: 0

Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.

Discussion

  • Raymond Toy

    Raymond Toy - 2004-11-22

    Logged In: YES
    user_id=28849

    What version of maxima?

    The documentation for the current CVS version doesn't say
    anything about not using any args for random.

     
  • Frank Thieme

    Frank Thieme - 2004-11-22

    Logged In: YES
    user_id=593167

    5.9.1

     
  • Raymond Toy

    Raymond Toy - 2004-11-22

    Logged In: YES
    user_id=28849

    Oops. You are right. I'm going to consider this a
    documentation bug since random expects an arg, and the CVS
    documentation says that random takes an arg.

    If you really want this to work, ask for an enhancement. Or
    something.

     
  • Robert Dodier

    Robert Dodier - 2004-11-24

    Logged In: YES
    user_id=501686

    I'm closing this report since doc/info/Operators.texi was
    updated (after the 5.9.1 release) to document the current
    behavior of "random".

    Maxima random just calls Lisp random. Frank, you're
    encouraged to file an enhancement request if additional
    functionality is needed.

    For reference here's the essential part of the description
    of "random" from current CVS: "If X is an integer, RANDOM
    (X) returns an integer from 0 through X-1 inclusive. If X is
    a floating point number, RANDOM (X) returns a nonnegative
    floating point number less than X."

     
  • Robert Dodier

    Robert Dodier - 2004-11-24
    • status: open --> closed
    • labels: --> Documentation
     

Log in to post a comment.