I need to read a data file in which numbers are written in a format like this:
1.0d-05
C++ doesn't seem to recognize this type of scientific notation! Any ideas on how I could read/convert those types of numbers?
I need numbers (i.e. double
/ float
) not strings. Maybe there is already a class / header to manage this format, but I could not find it.
Files produced by Fortran programs report double precision numbers (in scientific notation) using the letter D instead of E.
So your options are:
Use something like:
Also: