Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What number is e+000?

Tags:

c++

math

I have a data file full of numbers I'm loading into a vector of floats. However, the numbers in the data file are of the form -4.60517025e+000 but are being read in like -4.60517

What number should -4.60517025e+000 be?

like image 932
user346443 Avatar asked Dec 28 '22 23:12

user346443


1 Answers

The number -4.60517025e+000 is interpreted as -4.60517025 × 100 = -4.60517025.

More generally, a number of the form

AeB

is interpreted as A × 10B.

In your case, the file is being read properly, but the numbers are being rounded to some number of decimal points when being displayed. You can use stream manipulators to display them in their initial form.

Hope this helps!

like image 86
templatetypedef Avatar answered Dec 30 '22 13:12

templatetypedef