Decimal numbers in C language
is it possible to have the precision of 20 digits after the comma in C language (for example 10^-20)?If yes, how can I do it?
Member • Nov 10, 2012
Member • Nov 11, 2012
Member • Nov 11, 2012
Member • Nov 11, 2012
Member • Nov 11, 2012
Please read on what are floating numbers and how are they stored in memoryrukawaThank you rahul69. It was helpful.
Now when I calculate 1/239 using the float type I don't get the same result as when I calculate it using the double type :
Plus, the result I get when using a calculator is : 0,00418410041841004184100418410042 .
The result I got when using the float type is erroneous. The one I got using the double type is more accurate but I was enable to get more than 19 digits after the comma even though I precised in the program that the precision is of 30 digits after the comma. Is there a way to get a result more accurate with a better precision?
Member • Nov 11, 2012
Member • Nov 11, 2012
Member • Nov 11, 2012
Thank you for your advice. Do you know a good book or article where I can get this cleared up?simplycoderPlease read on what are floating numbers and how are they stored in memory
also how to set precision in c
You would get your doubts cleared.
Member • Nov 11, 2012
Member • Nov 29, 2012