On 2020/02/02 18:51:08, Dan Eble wrote:
> LGTM
> 
> https://codereview.appspot.com/547560044/diff/555240043/lily/spring.cc
> File lily/spring.cc (right):
> 
>
https://codereview.appspot.com/547560044/diff/555240043/lily/spring.cc#newcode119
> lily/spring.cc:119: avg_stretch /= static_cast<Real> (springs.size
());
> This is not an issue with this change, but should this function do
something
> other than divide by zero when springs is empty?

Possibly.  We have had a few reports of combinations of forced breaks
leading to failed assertions.  Dividing by Real zero (which was done
here before as well due to conversion rules) does not throw
divide-by-zero but results in ±inf.0 (unless the numerator is also zero,
then you get ±nan.0).  So I won't rule out that some of the triggering
cases might have come through this code path.

https://codereview.appspot.com/547560044/

Reply via email to