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#newcod...
> 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.
Issue 547560044: Cast to Real in C++ style throughout
(Closed)
Created 5 years, 1 month ago by hanwenn
Modified 5 years, 1 month ago
Reviewers: Dan Eble, dak
Base URL:
Comments: 2