]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/rational.hh
Merge branch 'master' of git://git.sv.gnu.org/lilypond
[lilypond.git] / flower / include / rational.hh
index 461b2522a285de9ee5f6488706dd51ce38d3f70e..ac1a6d12fc1e0ae01eccc2bb3d9d6ed65cfd83b1 100644 (file)
@@ -28,7 +28,7 @@ class Rational
   */
   int sign_;
   unsigned int num_, den_;
-  void normalise ();
+  void normalize ();
   void copy (Rational const &);
 
 public:
@@ -43,9 +43,10 @@ public:
   Rational trunc_rat () const;
   Rational div_rat (Rational) const;
   Rational mod_rat (Rational) const;
+  Rational abs () const;
   void negate ();
   int to_int () const;
-  operator bool () const;
+
   operator double () const;
 
   Rational operator - () const;
@@ -54,8 +55,8 @@ public:
   */
   Rational ();
   Rational (int);
-  Rational (int, int);
-  Rational (double);
+  explicit Rational (int, int);
+  explicit Rational (double);
   Rational (Rational const &r) { copy (r);}
   Rational &operator = (Rational const &r)
   {
@@ -69,10 +70,11 @@ public:
   Rational &operator %= (Rational);
   static int compare (Rational const &, Rational const &);
   int sign () const;
-  std::string to_string () const;
+  string to_string () const;
 };
 
 #include "arithmetic-operator.hh"
+
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, /);
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, +);
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, *);
@@ -97,6 +99,6 @@ ostream &
 operator << (ostream &, Rational);
 #endif
 
-const Rational infinity_rat = INT_MAX;
+const Rational infinity_rat (INT_MAX);
 
 #endif // RATIONAL_HH