Also I wanted to try out this source code formatting tool for blogspot. The snippet below is a unit test written in the UnitTest++ framework.
#include <UnitTest++.h>
#include <boost/math/special_functions/modf.hpp>
using namespace boost::math;
SUITE(BOOST_MATH_MODF) {
const double pi = 3.141592653589793;
TEST(modf) {
double* pIntegerPart = new double;
CHECK_CLOSE(0.141592653589793, modf( pi, pIntegerPart ), 1e-15);
CHECK_CLOSE(3.0, *pIntegerPart, 1e-15);
delete pIntegerPart;
}
}

No comments:
Post a Comment