10 #include "paranoidnumber.h"
15 int main(int argc, char ** argv)
17 Debug("FLT_MAX = %.40f", FLT_MAX);
18 Debug("FLT_MIN = %.40f", FLT_MIN);
19 Debug("FLT_EPSILON = %.40f", FLT_EPSILON);
21 ParanoidNumber a("0.3");
22 Debug("start at {%s} = %lf", a.Str().c_str(), a.ToDouble());
31 for (char c = cin.peek(); cin.good() && !iswspace(c); c = cin.peek())
33 if (c == '+' || c == '-' || c == '*' || c == '/')
40 Debug("String is %s", token.c_str());
41 float fb = strtof(token.c_str(), NULL);
42 double db = strtod(token.c_str(), NULL);
43 ParanoidNumber b(token.c_str());
44 Debug("b is {%s} %lf", b.Str().c_str(), b.ToDouble());
69 Debug("a is: %s", a.Str().c_str());
70 Debug("a as double: %.40f\n", a.ToDouble());
71 Debug("floats give: %.40f\n", fa);
72 Debug("double gives: %.40f\n", da);