Date: Thu, 31 Jul 2003 09:40:11 -0700 (PDT) From: "David Brinegar" <jot.3.brinegar@spamgourmet.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/54878: incorrect divisor in /usr/bin/jot -r Message-ID: <200307311640.h6VGeB7n089016@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/54878; it has been noted by GNATS. From: "David Brinegar" <jot.3.brinegar@spamgourmet.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307311640.h6VGeB7n089016>