Advertisement
Guest User

Untitled

a guest
Apr 27th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.00 KB | None | 0 0
  1. static s32 capacity_algo(s32 capacity)
  2. {
  3.     int rtn = 50;
  4.  
  5.     if(capacity >= 100 ) //5% range, 100% - 70%
  6.         rtn = 100;
  7.     else if (capacity >= 99)
  8.         rtn = 99;
  9.     else if (capacity >= 95)
  10.         rtn = 95;
  11.     else if (capacity >= 90)
  12.         rtn = 90;
  13.     else if (capacity >= 85)
  14.         rtn = 85;
  15.     else if (capacity >= 80)
  16.         rtn = 80;
  17.     else if (capacity >= 75)
  18.         rtn = 75;
  19.     else if (capacity >= 70)//10% range, 70% - 20%
  20.         rtn = 70;
  21.     else if (capacity >= 60)
  22.         rtn = 60;
  23.     else if (capacity >= 50)
  24.         rtn = 50;
  25.     else if (capacity >= 40)
  26.         rtn = 40;
  27.     else if (capacity >= 30)
  28.         rtn = 30;
  29.     else if (capacity >= 20)
  30.         rtn = 20;
  31.     else if (capacity >= 15) //5% ragne, 20% - 0%
  32.         rtn = 15;
  33.     else if (capacity >= 10)
  34.         rtn = 10;
  35.     else if (capacity >= 5)
  36.         rtn = 5;
  37.     else if (capacity >= 1)
  38.         rtn = 1;
  39.     else if (capacity == 0)
  40.         rtn = 0;
  41.  
  42.     return rtn;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement