(all-grob-descriptions): remove gap from
[lilypond.git] / lily / misc.cc
blobbd7cce55c7e4fc887e3985d18c5ba20ec107d225
1 /*
2 misc.cc -- implement various stuff
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
8 */
10 #include <math.h>
11 #include "misc.hh"
14 Return the 2-log, rounded down
16 int
17 intlog2 (int d)
19 assert (d);
20 int i=0;
21 while ((d != 1))
23 d /= 2;
24 i++;
27 assert (! (d/2));
28 return i;
31 double
32 log_2 (double x)
34 return log (x) /log (2.0);