Re: Random??

From: Erick Gallesio <eg_at_kaolin.unice.fr>
Date: Tue, 14 Nov 1995 18:16:16 +0000

> Angelo Saccomano writes

>
> I have some problem with the use of Scheme function
> "Random". It seems that for n=power of 2 the value returned is not
> so random...

According to Andrew Joseph Kompanek <ak10+_at_andrew.cmu.edu>

        I soon realized that STk uses
        the stdlib rand() function which is known to be broken (at least on most
        Unix's). Among other problems, it *CYCLES* every n calls when
        n is a power of 2!

        At any rate, rand() is now considered obsolete -- so random() should
        really be used instead. Guess this should be fixed in the next
        release and everybody should make this change if they want reasonable
        pseudo-random numbers.

The fix is simple but it is not so simple if we want to change the seed (in a
compatible way with previous releases).
Furthermore, I suspect that this function is not on all systems, and it should
necessitate some modifications in configure.

I will try to modify it for next release.


                -- Erick
Received on Tue Nov 14 1995 - 18:16:16 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST