File: smallfn.cpp

package info (click to toggle)
unrar-nonfree 1%3A5.2.7-0.1%2Bdeb8u1
  • links: PTS
  • area: non-free
  • in suites: jessie
  • size: 1,344 kB
  • ctags: 3,512
  • sloc: cpp: 24,411; makefile: 124; sh: 10
file content (19 lines) | stat: -rw-r--r-- 259 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "rar.hpp"

int ToPercent(int64 N1,int64 N2)
{
  if (N2<N1)
    return(100);
  return ToPercentUnlim(N1,N2);
}


// Allows the percent larger than 100.
int ToPercentUnlim(int64 N1,int64 N2)
{
  if (N2==0)
    return(0);
  return (int)(N1*100/N2);
}