Rounding Error Prevention

I just read about rounding errors in C ++. So, if I am doing a program with intensive mathematical computation (or any important calculations), should I just reset the tooltips and use only doubles, or is there an easier way to prevent rounding errors?

+3
source share
2 answers

Mandatory lecture: What every programmer should know about floating point arithmetic .

Also try reading the IEEE floating point standard .

You will always have rounding errors. If you do not use a library of arbitrary precision infin, gmplib. , .

, . , , .

, float double, . Valgrind (grep float)...

+7

, . , , , - .

+1

Source: https://habr.com/ru/post/1683782/


All Articles