bin/54878: incorrect divisor in /usr/bin/jot -r

David Brinegar jot.3.brinegar at spamgourmet.com
Thu Jul 31 09:40:12 PDT 2003


The following reply was made to PR bin/54878; it has been noted by GNATS.

From: "David Brinegar" <jot.3.brinegar at spamgourmet.com>
To: "David Schultz  - das at FreeBSD.ORG" <+jot+brinegar+c45043f3f4.das#FreeBSD.ORG at spamgourmet.com>
Cc: FreeBSD-gnats-submit at 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


More information about the freebsd-bugs mailing list