Re: RFC: mt_* functions
| From: | James E. Flemer | Date: | Fri, 10 Aug 2001 19:14:20 +0000 |
| Subject: | Re: RFC: mt_* functions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-62867@lists.php.net to get a copy of this message | ||
On Sat, 4 Aug 2001, Rasmus Lerdorf wrote:
> > >Sure, although rand() tends to be the same everywhere as well. At least
> > >on all the systems I care about it is the same. Linux, FreeBSD, OpenBSD
> > >and Solaris all seem to use the same algorithm.
> >
> > Then why do some people have troubles with rand() on Solaris? :)
> > Or is it some specific version of it?
>
> No idea.
>
> -Rasmus
On solaris ... there is a rand() function in the BSD compat
libs.
$ man -s 3ucb rand
...
The low bits of the numbers generated are not very random;
use the middle bits. In particular the lowest bit alternates
between 0 and 1.
...
Possibly the guy with the problems somehow linked the BSD
compat libs by mistake? I have no problems with rand() on
Solaris 8.
-James