http://codereview.appspot.com/4536068/diff/30001/lily/multi-measure-rest.cc
File lily/multi-measure-rest.cc (right):

http://codereview.appspot.com/4536068/diff/30001/lily/multi-measure-rest.cc#newcode131
lily/multi-measure-rest.cc:131: int measure_duration_log = int (ceil
(duration_log));
To me, having done numerical work, the chain of functions you use, int(
ceil( -log2(x))), is easily recognizable as "find the smallest n so that
1 / 2^n <= x".

While log2 is inexact, the results when x is a power of 2 are exact
(IEEE-compliant floating-point represents integers and integer powers of
2 exactly) so reliably 3/4 and 2/4 both come out 1 (half/minim rest).

http://codereview.appspot.com/4536068/diff/30001/lily/multi-measure-rest.cc#newcode132
lily/multi-measure-rest.cc:132: if (round && duration_log -
measure_duration_log < 0)
This, however, makes me pause, then wonder why you didn't use the same
idiom
 if (to_boolean(me->get_property ("round-to-longer-rest"))
   measure_duration_log = int (floor (duration_log));
 else
   measure_duration_log = int (ceil (duration_log));

http://codereview.appspot.com/4536068/

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to