[Insight-developers] vnl updates : Rounding Test : Performance and Correctness

Luis Ibanez luis.ibanez at kitware.com
Wed Dec 31 08:22:35 EST 2008



Tom Vercauteren wrote:
> Hey Luis,
> 
> 
>>BTW,
>>If somebody can also explain why the rounding
>>errors appear only in:
>>
>>                 -8.5  and -6.5
>>
>>and not in all even numbers in the range -10:10
>>
>>  -8.5, -6.5, -4.5, -2.5, 0.5, 2.5, 4.5, 6.5, 8.5
>>
>>
>>that will be very kind as well...   :-)
> 
> 
> In you test case you are not actually testing how half-integers are
> rounded. As far as I can tell, since you start from -10 and increment
> it by very small floating points, there is no reason for your test to
> fall exactly on half integers. You may very well get for example
> -2.5000000000000000000000000001 instead of -2.5. Therefore as you are
> not rounding  -8.5, -6.5, -4.5, -2.5, 0.5, 2.5, 4.5, 6.5, 8.5 , they
> cannot fail :)
> 
> Tom
> 
--------------

Thank You,
Thank You,
Thank You,

I'll make sure to add the .5 entries to the list of values.


    Luis


More information about the Insight-developers mailing list