X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Freal.hh;h=9186b44d3641358e5b1f987515f68ff9b33a4575;hb=8c152b04a45bd6c03dd6be51ed1c09368a209a34;hp=d2667110a9b00e6bbdcc98c395613c7854bb60dd;hpb=48f2b9351f93d0161c675cfb60e95bf919041df2;p=lilypond.git diff --git a/flower/include/real.hh b/flower/include/real.hh index d2667110a9..9186b44d36 100644 --- a/flower/include/real.hh +++ b/flower/include/real.hh @@ -3,51 +3,45 @@ source file of the Flower Library - (c) 1997--1999 Han-Wen Nienhuys + (c) 1997--2007 Han-Wen Nienhuys */ - #ifndef REAL_HH #define REAL_HH - -#include +#include +#include +#include +using namespace std; typedef double Real; extern const Real infinity_f; +/* namespace std { */ + template inline T abs (T x) { return x > 0 ? x : -x; } -template inline int sign (T x) -{ - if (x) - return x > T(0) ? 1 : -1; - return 0; -} - -template inline T max (T x, T y) -{ - return x >? y; -} +/* } namespace std */ -template inline T sqr (T x) +inline Real +distance (Real x, Real y) { - return x*x; + return abs (x - y); } - -template inline T min (T x, T y) +template inline int sign (T x) { - return x T (0) ? 1 : -1; + return 0; } -inline Real -distance (Real x,Real y) +template inline T sqr (T x) { - return abs (x-y); + return x * x; } #endif