[Insight-developers] failing itkMathRoundProfileTest1: time to adjust helper function for portable rounding?

Michel Audette michel.audette at kitware.com
Mon Jun 1 17:32:59 EDT 2009


Dear members of the community,

I'm hammering away at portable-round and pixel-centering related failing
tests
http://www.cdash.org/CDash/viewTest.php?onlyfailed&buildid=345664 , and one
of the laggards is the itkMathRoundProfileTest1.

If I understand the portable round fix correctly, it rounds to the next
highest integer irrespective of whether or not the input number is positive
or negative, so that the following in  itkMathRoundProfileTest1 is now
inappropriate:

double itkMathRoundTestHelperFunction( double x )
{
  if( x >= 0.0 )
    {
    return static_cast< int >( x + 0.5f );
    }

 return static_cast< int >( x - 0.5f );
}

Is that correct?

Cheers,

Michel

-- 
Michel Audette, Ph.D.
R & D Engineer,
Kitware Inc.,
Chapel Hill, N.C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090601/ab0c9acb/attachment.htm>


More information about the Insight-developers mailing list