On Wed, Sep 29, 2010 at 2:44 PM, Roman Divacky <rdiva...@freebsd.org> wrote:
> heh, now I noticed that Derek already wrote that ;) is anyone able
> to find where in perl sources the rand function is defined? I failed
> that :(

It's using drand48() instead of rand()

r...@botelhor:/usr/ports/lang/perl5.12# make configure |& grep -i rand
drand48_r() NOT found.
random_r() NOT found.
srand48_r() NOT found.
srandom_r() NOT found.
Looking for a random number function...
Good, found drand48().
Use which function to generate random numbers? [drand48]
Checking how to generate random libraries on your machine...

Test results here:

GCC libc:
ga...@botelhor:~/testes> ./test
random value 0.396465

clang libc:
ga...@botelhor:~/testes> ./test
random value -inf

Source of test.c:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main() {
        printf("random value %f\n", drand48());
        exit(0);
}

-- 
Renato Botelho
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to