Nitpick: ly:spanner-bound grob name slur -> spanner.
[lilypond.git] / flower / include / real.hh
blobeba8a50b8e75468cf39a7c85089ff382a8107062
1 /*
2 real.hh -- declare Real
4 source file of the Flower Library
6 (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #ifndef REAL_HH
10 #define REAL_HH
12 #include <algorithm>
13 #include <climits>
14 #include <cmath>
15 using namespace std;
17 typedef double Real;
18 extern const Real infinity_f;
20 /* namespace std { */
22 template<class T> inline T abs (T x)
24 return x > 0 ? x : -x;
27 /* } namespace std */
29 inline Real
30 distance (Real x, Real y)
32 return abs (x - y);
35 template<class T> inline int sign (T x)
37 if (x)
38 return x > T (0) ? 1 : -1;
39 return 0;
42 template<class T> inline T sqr (T x)
44 return x * x;
47 #endif