you can modifiy the precision of the output (i.e. the printed digits) with a call to cout.precision(16). However, if you're using float as the data type you will get an incorrect result, since float has only 7 significant digits in decimal system. If you want better precision (10254158.3454 contains 12 digits) you should use double or maybe even long double.