logo       

Re: random/1: msg#01554

Subject: Re: random/1
Random is an arithmetic function, and so can only be used within an arithmetic expresssion.

2 ?- Rnd is random(100).

Rnd = 8

Yes

On 12/12/05, dazy <dazy@xxxxxxx> wrote:
Hi,
why random/1 dont work on Version 5.5.38 ?

the reference exist in help :
random(+IntExpr)
    Evaluates to  a random integer i for which 0=< i< IntExpr.  The seed
    of  this random  generator is  determined by the  system clock  when
    SWI-Prolog was started.

25 ?- random(100).
ERROR: Undefined procedure: random/1
26 ?-

  Cheers,

jf dazy




------------
For further info, please visit http://www.swi-prolog.org/

To unsubscribe, send a plaintext mail with "unsubscribe prolog <e-mail>"
in its body to majordomo@xxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>