jeudi 4 août 2016

Digits in float and double variable

Why is the number of digits stored by both float as well as double variable same, isn't double supposed to store more digits than float

#include <iostream>
using namespace std;
int main(){
double a = 3.141528579238;
float b = 3.141528579238; 
cout << a << " " << b;
return 0;
}

I'm getting this as my output

3.14153 3.14153

Aucun commentaire:

Enregistrer un commentaire