Author: jgg
Date: 2000-06-05 04:22:25 GMT
Floating point error. Bug #64394
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: progress.cc,v 1.8 1998/10/02 04:39:53 jgg Exp $
+// $Id: progress.cc,v 1.9 2000/06/05 04:22:25 jgg Exp $
/* ######################################################################
OpProgress - Operation Progress
/* ######################################################################
OpProgress - Operation Progress
percent of Total SubTotal is. */
void OpProgress::Progress(unsigned long Cur)
{
percent of Total SubTotal is. */
void OpProgress::Progress(unsigned long Cur)
{
- Percent = (Current + Cur/((float)SubTotal)*Size)*100.0/Total;
+ if (Total == 0 || Size == 0 || SubTotal == 0)
+ Percent = 0;
+ else
+ Percent = (Current + Cur/((float)SubTotal)*Size)*100.0/Total;
this->Size = Size;
this->Op = Op;
SubOp = string();
this->Size = Size;
this->Op = Op;
SubOp = string();
- Percent = Current*100.0/Total;
+ if (Total == 0)
+ Percent = 0;
+ else
+ Percent = Current*100.0/Total;
{
this->SubTotal = SubTotal;
SubOp = Op;
{
this->SubTotal = SubTotal;
SubOp = Op;
- Percent = Current*100.0/Total;
+ if (Total == 0)
+ Percent = 0;
+ else
+ Percent = Current*100.0/Total;
void OpProgress::SubProgress(unsigned long SubTotal)
{
this->SubTotal = SubTotal;
void OpProgress::SubProgress(unsigned long SubTotal)
{
this->SubTotal = SubTotal;
- Percent = Current*100.0/Total;
+ if (Total == 0)
+ Percent = 0;
+ else
+ Percent = Current*100.0/Total;