26 #include <boost/lexical_cast.hpp> 29 using boost::lexical_cast;
58 int range = 0 < arg.size()? lexical_cast<
int> (arg[0]) : 12;
59 int scale = 1 < arg.size()? lexical_cast<
int> (arg[1]) : 4;
61 checkWrap (range, scale);
62 checkWrap (range, -scale);
63 checkWrap<long> (range, scale);
64 checkWrap<long> (range, -scale);
70 checkWrap (I range, I scale)
72 cout <<
"--------"<< typeStr<I>()
73 <<
"--------"<< range<<
"/"<<scale<<endl;
74 for (I i=range; i >=-range; --i)
80 showWrap (I val, I scale)
83 cout <<
_Fmt (
"% 3d /% 1d =% 1d %% =% d floor=% 4.1f wrap = (%2d,%2d)\n")
84 % val % scale % (val/scale)
85 % (val%scale) % floor(
double(val)/scale)
86 % 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.
Simplistic test class runner.
Utilities for quantisation (grid alignment) and comparisons.
A collection of frequently used helper functions to support unit testing.