]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/rational.cc
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / flower / rational.cc
index 2d57eebef09a73bf3caaeb307e1159b68d321f58..559e1646a0cade47b932d7cfab048f0feb641da8 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -216,11 +216,11 @@ Rational::compare (Rational const &r, Rational const &s)
     return -1;
   else if (r.sign_ > s.sign_)
     return 1;
-  else if (r.is_infinity ())
+  else if (r.is_infinity ()) // here s is also infinite with the same sign
     return 0;
-  else if (r.sign_ == 0)
+  else if (r.sign_ == 0) // here s.sign_ is also zero
     return 0;
-  return r.sign_ * ::sign ((I64) (r.num_ * s.den_) - (I64) (s.num_ * r.den_));
+  return ::sign (r - s);
 }
 
 int