From owner-freebsd-hackers Sat Oct 5 20:29:53 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA04341 for hackers-outgoing; Sat, 5 Oct 1996 20:29:53 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id UAA04318; Sat, 5 Oct 1996 20:29:44 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id NAA08899; Sun, 6 Oct 1996 13:27:32 +1000 Date: Sun, 6 Oct 1996 13:27:32 +1000 From: Bruce Evans Message-Id: <199610060327.NAA08899@godzilla.zeta.org.au> To: ache@nagual.ru, bde@zeta.org.au Subject: Re: I plan to change random() for -current (was Re: rand() and random()) Cc: current@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG, joerg_wunsch@uriah.heep.sax.de Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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