Buglet in QuickCheck

Dylan Thurston dpt@math.harvard.edu
Thu, 4 Jul 2002 09:05:30 -0400


--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 04, 2002 at 02:31:47PM +0200, Martin Norb?ck wrote:
> ons 2002-07-03 klockan 15.50 skrev Dylan Thurston:
> > In the definition of 'done' in QuickCheck, there is the following
> > definition:
> >=20
> > > percentage n m        =3D show ((100 * n) `div` m) ++ "%"
> >=20
> > There may be specific reasons for wanting to round downwards, but
> > failing that, a more accurate function would be
> >=20
> > > percentage n m        =3D show ((200 * n + m) `div` (2 * m)) ++ "%"
>=20
> I would say there are good reasons for rounding down. You don't want it
> to say 100% until is completely done, for instance.

As it happens, this function is only called for the grouping of the
data (like 66% trivial, 33% interesting), where I might argue that you
do want rounding.  Not a big deal either way.

--Dylan

--82I3+IH0IqGh5yIs
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9JEgZVeybfhaa3tcRAjp2AJ97O7fk03dPDaj30vW4bbDZDY7DJACfYFY5
hAy4jyHcWQsuXR1ZHrPLbzg=
=p+Hk
-----END PGP SIGNATURE-----

--82I3+IH0IqGh5yIs--