Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. int log(int base, int m)
  2. {
  3. int res = 0;
  4. int _m = base;
  5.  
  6. if ((m == 0) || (base == 0) || (base == 1))
  7. return res;
  8.  
  9. while (_m <= m)
  10. {
  11. _m = _m * base;
  12. res += 1;
  13. }
  14.  
  15. return res;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement