I am working on my knowledge in C++ and I am expecting a value which I did not receive. Here is my code
#include <iostream>
#include <float.h>
using std:: cout;
using std:: endl;
using std:: fixed;
float a = 10.0 / 3;
a = a * 10000000000000000000;
double b = 10.0 / 3;
b = b * 10000000000000000000;
long double c = 10.0 / 3;
c = c * 10000000000000000000;
cout << fixed << a << endl; // I get 33333333268354826240.000000
cout << fixed << b << endl; // I get 33333333333333336240.000000
cout << fixed << c << endl; // I get 33333333333333336240.000000 but this should be more accurate
cout << FLT_DIG << endl; // I am getting 6
cout << DBL_DIG << endl; // I am getting 15
cout << LDBL_DIG << endl; // I am getting 15 but this should be 18
So am I doing something wrong? I followed how the tutoiral did it but I'm not sure why. So I am using Microsoft Visual Studio 2019 if that helps.