Closed GoogleCodeExporter closed 8 years ago
Math.ceil() works on doubles. There is a loss of precision in the current code
when
calculating the number of chunks required should change to something like:
Volume volume = new Volume(targetName,
numCopies,
numLUNs,
numBlocks,
blockSize,
(int) Math.ceil((numLUNs *
blockSize *
numBlocks)/
(double)volumeChunkSize), // must make double so that ceil works correclty
volumeChunkSize);
Original comment by tommy.mu...@gmail.com
on 15 Apr 2009 at 10:43
Solution:
calculate numChunks inside Volume() constructor so that we don't need to
calculate it
in multiple places.
Original comment by tommy.mu...@gmail.com
on 15 Apr 2009 at 11:11
fixed as of Revision 24.
Note: code in VirtualDisk.java is still incorrect but that code is slated to be
removed soon.
Original comment by tommy.mu...@gmail.com
on 15 Apr 2009 at 11:49
Original issue reported on code.google.com by
tommy.mu...@gmail.com
on 15 Apr 2009 at 10:42