how can I increase accuracy in double.
for example in this code:
#include <stdio.h>
int main() {
long double a = (long double) 5 / 3;
printf("%.62LLF", a);
return 0;
}
how can I increase accuracy in double.
for example in this code:
#include <stdio.h>
int main() {
long double a = (long double) 5 / 3;
printf("%.62LLF", a);
return 0;
}
Floating Point Numbers have a limited precision. Mandatory Reading Here.
The boost.multiprecision library can give you access to higher precision floating point numbers, whether in the form of quad
types which simply double the precision of double
, or in the form of arbitrary precision rational
numbers. If you're willing to take the time to learn how to install and use that library, you'll be able to improve the precision of your numbers.