Error in rand
Posted: Mon Jul 10, 2006 5:41 am
Hello all!
It seems that there is a small error in 'rand':
Length of the generated list should be 10 (= N). 'rand' keeps returning one more than is needed.
This way:
Also:
never returns result (infinite loop).
- Fanda
PS: I am using newLISP v.8.9.0 on Win32 MinGW
It seems that there is a small error in 'rand':
Code: Select all
> (set 'N 10)
10
> (rand 3 N)
(2 0 1 1 0 2 2 2 2 0 2)
> (length (rand 3 N))
11
This way:
Code: Select all
> (rand 5 0)
(4)
Code: Select all
> (rand 5 -1)
- Fanda
PS: I am using newLISP v.8.9.0 on Win32 MinGW