]> git.donarmstrong.com Git - lilypond.git/blob - real.hh
release: 0.0.2
[lilypond.git] / real.hh
1 #ifndef REAL_HH
2 #define REAL_HH
3 typedef double Real;
4 inline Real sqr(Real x){
5     return x*x;
6 }
7 inline Real MIN(Real x, Real y) {
8     return (x < y)? x : y;
9 }
10
11 inline Real MAX(Real x, Real y) {
12     return (x > y) ? x : y;
13 }
14
15 inline Real ABS(Real x)
16 {
17     return (x>0)? x:-x;
18 }
19 inline
20 int sgn(Real x) {
21     if (!x)return 0;
22     return (x > 0) ?1: -1;
23 }
24
25 #endif