]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/real.hh
* lily/tie-column.cc (set_manual_tie_configuration): new function.
[lilypond.git] / flower / include / real.hh
1 /*
2   real.hh -- declare Real
3
4   source file of the Flower Library
5
6   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef REAL_HH
10 #define REAL_HH
11
12 #include <algorithm>
13 #include <climits>
14 #include <cmath>
15 using namespace std;
16
17
18 typedef double Real;
19 extern const Real infinity_f;
20
21 /* namespace std { */
22   
23 template<class T> inline T abs (T x)
24 {
25   return x > 0 ? x : -x;
26 }
27
28 /* } namespace std */
29
30 inline Real
31 distance (Real x, Real y)
32 {
33   return abs (x - y);
34 }
35
36 template<class T> inline int sign (T x)
37 {
38   if (x)
39     return x > T (0) ? 1 : -1;
40   return 0;
41 }
42
43 template<class T> inline T sqr (T x)
44 {
45   return x * x;
46 }
47
48 #endif