From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 31 09:40:12 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B67A37B401 for ; Thu, 31 Jul 2003 09:40:12 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38B0043F3F for ; Thu, 31 Jul 2003 09:40:12 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6VGeBUp089017 for ; Thu, 31 Jul 2003 09:40:11 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6VGeB7n089016; Thu, 31 Jul 2003 09:40:11 -0700 (PDT) Date: Thu, 31 Jul 2003 09:40:11 -0700 (PDT) Message-Id: <200307311640.h6VGeB7n089016@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "David Brinegar" Subject: Re: bin/54878: incorrect divisor in /usr/bin/jot -r X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David Brinegar List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2003 16:40:12 -0000 The following reply was made to PR bin/54878; it has been noted by GNATS. From: "David Brinegar" To: "David Schultz - das@FreeBSD.ORG" <+jot+brinegar+c45043f3f4.das#FreeBSD.ORG@spamgourmet.com> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/54878: incorrect divisor in /usr/bin/jot -r Date: Thu, 31 Jul 2003 09:32:35 -0700 David Schultz wrote: > Actually, to be compatible with the non-random behavior, and to > make the random letter example in the manpage actually work, jot > needs to treat integers and floating point numbers differently. > In particular, 'jot -w %d -r 1000 1 4' needs to give integers > uniformly distrubited over [1,4], whereas 'jot -w %f -r 1000 1 4' > needs to give floating point numbers uniformly distributed over > the same range. Well, I wonder how many people use the current distribution on purpose. We have a few scripts around here that would need to be adjusted to the new range. If someone is using jot to pick 1, 2, or 3 and after an upgrade it starts picking 4 as well, then the script will randomly not work. I sent a pr to change the man page for these issues, thinking that the path of least change is just to point out what is happening so that people who haven't already figured it out can get a clue from the man page. Correcting the arc4random() divisor will not impact anyone, as it only prevents a problem with arc4random() == 0xFFFFFFFF. -- David Brinegar