retaining the precison after reading and writing the double values to binary file
<p>I am creating a binary file. the contents of the files are double values.
When I extract the double values using a binary reader, some values after the decimal points are not matching </p>

<p>For ex:
the value written to a file.
-0.0139519833028316</p>

<p>Value extracted from a file.
-0.0139519833028317</p>

<p>How I can avoid this kind of inconsistency?</p>

<pre><code>aStreamWriter.WriteLine(double values);

//to read the data ,
BinaryReader aBinaryReader = new BinaryReader();
int points_length = CurveCount * VectorLength * 2 * VoxelIndex.Length * 2;
double[] points = new double[points_length];
for (int i = 0; i &lt; points_length; i++)
    points[i] = aBinaryReader.ReadDouble();
for(int i =0; i &lt; points_length; i++) {
    // then write the points values to a file
}
</code></pre>
