]> git.donarmstrong.com Git - lilypond.git/blob - lily/misc.cc
release: 0.1.8
[lilypond.git] / lily / misc.cc
1 /*
2   misc.cc -- implement various stuff
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include <math.h>
10
11 #include "item.hh"
12 #include "misc.hh"
13 #include "moment.hh"
14
15 int
16 intlog2(int d) {
17     int i=0;
18     while (!(d&1)) {
19         d/= 2;
20         i++;
21     }
22     assert (!(d/2));
23     return i;
24 }
25
26 double
27 log_2(double x) {
28     return log (x)  /log (2.0);
29 }
30
31 #if 1
32 Interval
33 itemlist_width (const Array<Item*> &its)
34 {
35     Interval iv ;
36     iv.set_empty();
37      
38     for (int j =0; j < its.size(); j++){
39         iv.unite (its[j]->width());
40
41     }
42     return iv;
43 }
44
45 #endif