Corrected overflow with ele_stop <= ele_start #440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Using
ele_stopintrack()implies that the last turn will be incomplete (unlessele_stop=0); hence no extra turns should be added.I.e. if we do
track(num_turns=2, ele_start=10, ele_stop=20)the first turn tracks from element 10 to the end, and the second turn from the start until element 20 (and similarly for e.g.num_turns=3where the middle turn is a complete one).In this case, nothing changes when
ele_stop <= ele_start:If we do
track(num_turns=2, ele_start=20, ele_stop=10)the first turn tracks from element 20 to the end, and the second turn from the start until element 10.There is one important exception: when
ele_stop <= ele_startandnum_turns=1. This is in principle impossible, but writingtrack(ele_start=20, ele_stop=10)should be a convenient way to track only a part of the line (that passes through the origin) without having to worry about increasingnum_turnsmanually. Hence, for this very specific overflow case, and only for this one, the tracker changesnum_turnsto 2.This was the original idea, however, the overflow was applied to all values of
num_turnswhich creates a discrepancy in physical interpretation between the casesele_stop <= ele_startandele_start < ele_stop.Checklist
Mandatory:
Optional: