X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Frational.cc;h=559e1646a0cade47b932d7cfab048f0feb641da8;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=2d57eebef09a73bf3caaeb307e1159b68d321f58;hpb=bb8a0a5387af94dd2702877256334b160575a730;p=lilypond.git diff --git a/flower/rational.cc b/flower/rational.cc index 2d57eebef0..559e1646a0 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2011 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys 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