]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/misc.cc
release: 1.3.52
[lilypond.git] / lily / misc.cc
index d9c56c4a8da2abd3a2fe5c7b7b4bc13456f2db8e..9ff95f2a020e9926ef66955f929d70d8f2c79bda 100644 (file)
@@ -3,22 +3,27 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
     Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #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;
 }