]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/rational.hh
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / flower / include / rational.hh
index bc64465cfe5db4c5758a4aa6c4bcc3de6609b449..49b2322ed717e464bf992afedda255f050b5f493 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the Flower Library
 
-  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #ifndef RATIONAL_HH
@@ -11,8 +11,6 @@
 
 #include "std-string.hh"
 
-#include "std-string.hh"
-
 /**
    Rational numbers.  Included is support for + and - infinity.
 */
@@ -47,15 +45,17 @@ public:
   void negate ();
   int to_int () const;
 
-  operator double () const;
+  operator double () const { return to_double (); }
+  double to_double () const;
 
   Rational operator - () const;
   /**
      Initialize to 0.
   */
   Rational ();
-  Rational (int, int);
-  Rational (double);
+  Rational (int);
+  explicit Rational (int, int);
+  explicit Rational (double);
   Rational (Rational const &r) { copy (r);}
   Rational &operator = (Rational const &r)
   {
@@ -98,6 +98,6 @@ ostream &
 operator << (ostream &, Rational);
 #endif
 
-const Rational infinity_rat = INT_MAX;
+const Rational infinity_rat (INT_MAX);
 
 #endif // RATIONAL_HH