vendredi 27 février 2015

large numbers and float and double in C

I need to deal with very large matrices and/or large numbers and I don't know why double result = 2251.000000 * 9488.000000 + 7887.000000 * 8397.000000; gives me the correct output of 87584627.000000. Same with int result.


However, if I use float result = 2251.000000f + ... etc, it gives me 87584624.000000 and I have no idea why!


Can somebody tell me what I'm missing?


Aucun commentaire:

Enregistrer un commentaire