lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: optimal-page-breaking: signed/unsigned bug; issue 1553 (issue 227500


From: Keith OHara
Subject: Re: optimal-page-breaking: signed/unsigned bug; issue 1553 (issue 22750045)
Date: Wed, 20 Nov 2013 11:26:59 -0800
User-agent: Opera Mail/12.16 (Win32)

On Wed, 20 Nov 2013 00:53:24 -0800, <address@hidden> wrote:

If min_sys_count would happen
to be negative, this loop will never get run at all

Exactly that was happening with the example from issue 1553, before the patch.

The code above seemed to be trying to ensured that  min_sys_count >= 0  but 
thinking in terms of signed arithmetic.  Probably better to leave min_sys_count 
unsigned and write the subtractions above as saturating subtractions.   If you have a 
favorite idiom for  (x > y) ? x - y : 0  that would be clear up in the changed 
code further above, type it in.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]