You can probably get a bit more accuracy with a long double, but you should recognise that all electronic calculating devices will have rounding errors. You may want to think closer on what accuracy you require and what errors you can expect from the native machine types.
In a sense, yes, but it applies to all languages since it is a result of the binary system used internally. The problem is in the conversion from decimal to binary. The number .0016 is representable in decimal with a terminating fraction, but in binary it is a repeating fraction. Since there is only so many bits to represent a number, it cannot be represented exactly (in binary). Converting to double will not change the situation.
I like your code Hammurabi, but the reason I am using fscanf is because I am reading in a highly formatted text file that contains many delimiters. Will fin give me the same flexibility when reading in these files, such as looking for delimiters, reading in single or multiple lines, etc?
1) I am writing a code in MATLAB that verifies what the C++ code outputs. Some of the numbers are e-5 or e-6 in precision. So I only need a little precision, but the major problem is that I need the roundoff error in MATLAB and C++ to be the same, the easiest way for me to do this is get 15 digits of precision in C++.
2) I will look into stream commands for future use, but I do have a handle on fscanf, and other similar functions. I am not here to argue which functions are best, but I can say that I know which functions I am more comfortable with, but I am always looking for better tools to do my job.