%logBase2(number) -> number
%Author: James Atlas
%Description:
%  Calculates an integer logarithm of a number in base 2.
%Examples:
%  logBase2(16) -> 4
%  logBase2(15) -> 3
%  logBase2(17) -> 4
function out=logBase2(number)
  count = 0;
  test = number;
  while(test >= 2) 
      test = test / 2;
      count = count + 1;
  end
out = count;