why can't i add 100.0 to value?
typedef ttmath::Big<2, 2> big;
big max_double = std::numeric_limits<double>::max();
big a = max_double;
big b = 100.0;
big r = a + b;
//shouldn't r 100.0 bigger (not equal) then max_double?
assert(r > max_double);
The mantissa is too small, try:
std::cout << a << std::endl;
and you'll see:
When you add a 100 the 'a' will not change. If you want to store a 308 decimal digits number you have to use a container which has at least: log(1.797 * 10 ^308; 2) = 1024 bits for the mantissa, e.g: typedef ttmath::Big<2, TTMATH_BITS(1100)> big;
thanks for the fast reply AND the solution