Calculate block count using floating point math and Ceiling() for accuracy

This commit is contained in:
Michael Becker 2015-07-24 12:04:39 -04:00
parent 0a3ad275c1
commit bcf2e31a51

View File

@ -259,7 +259,8 @@ namespace UniversalEditor.ObjectModels.FileSystem
long blockSize = (System.Environment.WorkingSet / BLOCK_FRACTION);
long offset = 0;
long blockCount = mvarSource.GetLength() / blockSize;
double dbl = ((double)mvarSource.GetLength() / (double)blockSize);
long blockCount = (long)Math.Ceiling(dbl);
if (transformations != null)
{