Buglet in QuickCheck

Martin Norbäck d95mback@dtek.chalmers.se
04 Jul 2002 14:31:47 +0200


ons 2002-07-03 klockan 15.50 skrev Dylan Thurston:
> In the definition of 'done' in QuickCheck, there is the following
> definition:
> 
> > percentage n m        = show ((100 * n) `div` m) ++ "%"
> 
> There may be specific reasons for wanting to round downwards, but
> failing that, a more accurate function would be
> 
> > percentage n m        = show ((200 * n + m) `div` (2 * m)) ++ "%"

I would say there are good reasons for rounding down. You don't want it
to say 100% until is completely done, for instance.

Regards,

	Martin

-- 
Martin Norbäck          d95mback@dtek.chalmers.se              
Kapplandsgatan 40       +46 (0)708 26 33 60                    
S-414 78  GÖTEBORG      http://www.dtek.chalmers.se/~d95mback/
SWEDEN                  OpenPGP ID: 3FA8580B