]> git.donarmstrong.com Git - lilypond.git/commitdiff
add Rational::to_double()
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 7 Jan 2007 00:58:50 +0000 (01:58 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 8 Jan 2007 10:27:40 +0000 (11:27 +0100)
flower/include/rational.hh
flower/rational.cc

index ac1a6d12fc1e0ae01eccc2bb3d9d6ed65cfd83b1..e124e76c7518a3745161e2755d909aacb7a68b0e 100644 (file)
@@ -47,7 +47,8 @@ public:
   void negate ();
   int to_int () const;
 
-  operator double () const;
+  operator double () const { return to_double (); }
+  double to_double () const;
 
   Rational operator - () const;
   /**
index 0d9515c367a59e8878b5228475c3dd2b9f5d18d0..8101d7c27714e6ef67405538dca5999db161d88c 100644 (file)
@@ -15,7 +15,8 @@ using namespace std;
 #include "string-convert.hh"
 #include "libc-extension.hh"
 
-Rational::operator double () const
+double
+Rational::to_double () const
 {
   return ((double)sign_) * num_ / den_;
 }