fix #840
Fixes #840 (closed) .
It was indeed an edge case. Basically you randomly drew all zeros: The test simulates a ti_current
by taking a valid time_begin
and adding a random displacement
< dt
to it.
You drew time_begin = 0
, and displacement = 0
, giving ti_current = 0
. The "expected correct result" was then wrong in the test, and wanted to see -16 (-dt) rather than 0.
This should fix it. Passes the offending test with the specified seed. Ran 100 additional 100 realizations, works as intended.
Merge request reports
Activity
assigned to @matthieu
- Resolved by Matthieu Schaller
I am sure you thought about it but could we not just escape early if
time_begin == 0
anddisplacement == 0
?
added 1 commit
- 47c17a2b - Simpler version where we just escape the offending unlucky draw
- Resolved by Matthieu Schaller
I have made that alternative change. Happy to have your opinion on what the best approach is.
requested review from @mivkov
mentioned in commit 6d1c89d9