2009-11-10 16:48:42 +01:00
|
|
|
#include "rar.hpp"
|
|
|
|
|
|
|
|
int ToPercent(int64 N1,int64 N2)
|
|
|
|
{
|
|
|
|
if (N2<N1)
|
2020-07-15 00:40:26 +02:00
|
|
|
return 100;
|
|
|
|
return ToPercentUnlim(N1,N2);
|
2009-11-10 16:48:42 +01:00
|
|
|
}
|
|
|
|
|
2020-07-15 00:40:26 +02:00
|
|
|
|
|
|
|
// Allows the percent larger than 100.
|
2009-11-10 16:48:42 +01:00
|
|
|
int ToPercentUnlim(int64 N1,int64 N2)
|
|
|
|
{
|
|
|
|
if (N2==0)
|
2020-07-15 00:40:26 +02:00
|
|
|
return 0;
|
|
|
|
return (int)(N1*100/N2);
|
2009-11-10 16:48:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|