]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/misc.hh
* configure.in: Test for and accept lmodern if EC fonts not found.
[lilypond.git] / lily / include / misc.hh
1 #ifndef MISC_HH
2 #define MISC_HH
3
4 #include <cstdlib>
5
6 #include "array.hh"
7 #include "interval.hh"
8
9 double log_2 (double x) ;
10 int intlog2 (int d);
11
12 inline int
13 sign (int i)
14 {
15   if (i<0)
16     return -1;
17   else if (i)
18     return 1;
19   else return 0;
20 }
21
22
23
24 inline Real
25 linear_interpolate (Real x, Real x1, Real x2,  Real y1, Real  y2)
26 {
27   return (x2 - x) / (x2 - x1) * y1 +
28     (x - x1) / (x2 - x1) * y2 ;
29 }
30
31
32
33 #endif
34