]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/misc.cc
release: 1.3.52
[lilypond.git] / lily / misc.cc
index 8597a8ce14636f2d0f4b3a70c8430975e384ba99..9ff95f2a020e9926ef66955f929d70d8f2c79bda 100644 (file)
 #include <math.h>
 #include "misc.hh"
 
+/*
+  Return the 2-log, rounded down 
+ */
 int
 intlog2(int d)
 {
   assert (d);
   int i=0;
-  while (!(d&1)) 
+  while ((d != 1)) 
     {
-       d/= 2;
-       i++;
+      d/= 2;
+      i++;
     }
+  
   assert (!(d/2));
   return i;
 }