Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22091

Why is %f working incorrectly for large double numbers in print statement? [duplicate]

$
0
0
double a = 1E100
printf("%f", a);

It seems to be printing a different value other than 1 followed by a 100 zeros:

10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104

What might be the problem here?


Viewing all articles
Browse latest Browse all 22091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>