Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualÁlvaro

Posted 11 January 2013 - 09:52 AM

How's this?
 
 
template <unsigned int b, unsigned int n>
struct log
{
  enum { value = log<b, n / b>::value + 1 };
};

template <unsigned int b>
struct log<b, 1>
{
  enum { value = 0 };
};

#1Álvaro

Posted 11 January 2013 - 09:52 AM

How's this?

 

template <unsigned int b, unsigned int n>
struct log
{
  enum { value = log<b, n / b>::value + 1 };
};
template <unsigned int b>
struct log<b, 1>
{
  enum { value = 0 };
};


PARTNERS