id summary reporter owner description type status milestone component version severity resolution keywords cc 12408 cpp_dec_float_50 x = x*x*x gives wrong result!!! Dave Nalepa John Maddock "I'm a beginner with C++ and with boost so I won't be surprised if I'm making some blunder but in case there's a real problem here, here goes: Using the multiprecision cpp_dec_float_50 I get a enormous error when I cube a variable. I'm using Microsoft VS2015 Community and making a console program (since my attempts at using boost with a cli program failed miserably). The core code (I think) is #include using boost::multiprecision::cpp_dec_float_50; // both at the global level = before main(){... I set f2 to this and then use the line f2 = f2*f2*f2; //to compute (f2)³ when f2 = 1.0335055959... I get the new f2 as 1.140909... which isn't even close to the correct value of 1.10392227... When I use a temporary variable, f3, it works just fine f3= f2*f2*f2 // f3 = 1.1039... It is probably some error the compiler is making, I don't know. This is obviously a worrisome bug. Simple arithmetic shouldn't give results that are off by 3% !! I'm not skilled enough in VS2015 to know what else to tell you about the switches that are or are not selected; I compile and run in the VS IDE. //===================================== here's the entire program (stub) // I've shortened 1.03559... but I still get the wrong value. #include #include #include using boost::multiprecision::cpp_dec_float_50; int main() { cpp_dec_float_50 f2 = (cpp_dec_float_50)(1.03559); f2 = f2*f2*f2; std::cout << ""f2 = "" << f2 << std::endl; // gives me 1.15.... which is wrong should be 1.1106... // it is actually the value of f2*f2*f2*f2, or close to it. return 0; }" Bugs closed To Be Determined multiprecision Boost 1.61.0 Problem fixed