35 #include <boost/lexical_cast.hpp> 38 using boost::lexical_cast;
67 int range = 0 < arg.size()? lexical_cast<
int> (arg[0]) : 12;
68 int scale = 1 < arg.size()? lexical_cast<
int> (arg[1]) : 4;
70 checkWrap (range, scale);
71 checkWrap (range, -scale);
72 checkWrap<long> (range, scale);
73 checkWrap<long> (range, -scale);
79 checkWrap (I range, I scale)
81 cout <<
"--------"<< typeStr<I>()
82 <<
"--------"<< range<<
"/"<<scale<<endl;
83 for (I i=range; i >=-range; --i)
89 showWrap (I val, I scale)
92 cout <<
_Fmt (
"% 3d /% 1d =% 1d %% =% d floor=% 4.1f wrap = (%2d,%2d)\n")
93 % val % scale % (val/scale)
94 % (val%scale) % floor(
double(val)/scale)
95 % wrap.quot % wrap.rem;
helper to treat int or long division uniformly
IDiv< I > floorwrap(I num, I den)
scale wrapping operation.
A front-end for using printf-style formatting.
Simple test class runner.
Utilities for quantisation (grid alignment) and comparisons.
A collection of frequently used helper functions to support unit testing.