Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Oct 1996 13:27:32 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        ache@nagual.ru, bde@zeta.org.au
Cc:        current@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG, joerg_wunsch@uriah.heep.sax.de
Subject:   Re: I plan to change random() for -current (was Re: rand() and random())
Message-ID:  <199610060327.NAA08899@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>You forget the fact that srandom() called only _once_ (usually),
>so speed is unimportant here.

I was thinking of getting it right here and copying it to the
kernel random() and the user rand().

>> Perhaps make this a subroutine to avoid duplication and allow easy
>> changing.  Division takes 10-20 times longer than a subroutine call
>> on Pentiums.

Actually 5-10 times on Pentiums, 3-5 times on 486's, 1-2 times on
386's.

>We can't relay on Pentium times in machine-independent code.

Speed is unimportant here :-).

>I am thinking about making it #define or inline, which one
>is better?

Inline.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610060327.NAA08899>