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?
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With