www.pudn.com > sfalic-03-src.rar.rar > ceillog2.h, change:2004-02-13,size:295b


#ifndef __CEILLOG2_H 
#define __CEILLOG2_H 
 
#include  
 
 
static int ceil_log_2(int val) /* sufit z log2 z val */ 
{ 
  int result; 
 
  assert(val>0); 
 
  if (val==1) 
    return 0; 
 
  result=1; 
  val-=1; 
  while (val>>=1) 
    result++; 
 
  return result; 
} 
 
 
#endif