db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew McIntyre <mcintyr...@gmail.com>
Subject Re: re DERBY-88
Date Wed, 08 Feb 2006 04:21:35 GMT

On Feb 7, 2006, at 7:59 PM, Myrna van Lunteren wrote:

>                 PercentPass = (int)Math.ceil(100* ((double)NumPass/ 
> (double)NumRun));
>                 PercentFail = (int)Math.floor(100* ((double)NumFail/ 
> (double)NumRun));

As soon as I saw this snippet, I knew exactly what was wrong with it.  
It's rounding in the wrong direction. Fail should be rounded to the  
ceiling, and pass should be floored to achieve the effect requested  
in the original issue. I put it there, so I'm certainly to blame.  
Maybe I checked in a copy I had been experimenting with.

Fixed with revision 375845. Note that the new behavior means that a  
really low pass percentage (but still above 0, will report 0% pass,  
and a really high fail percentage (but not actually total) will still  
report 100% fail. I'm assuming this is acceptable.


View raw message