3
Answers

DivideByZeroException exception

David Smith

David Smith

7y
514
1
The offset is going to zero, can someone tell me why and help me resolve this issue. I get a DivideByZeroException exception during the loop because the offset goes to zero
 
for (int offset = 0; offset <= File.Length; offset += buffersize)
{
 
I get a DivideByZeroException exception during the loop.

totalspeed = Math.Round((offset / (sw.ElapsedMilliseconds / 1000)) * 0.00000762939453125, 1);
}
Answers (3)