Construction of interval when mixing real and complex arguments #611
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.
When constructing an interval from one real and one complex argument I expected it to treat the imaginary part of the real argument as zero. What happens is instead that it takes the imaginary part of the interval to only depend on the complex argument, e.g.
Compare this to what we get if we make the first argument complex
This behavior could of course be by design, but since there are no tests for it I would guess that it is just a mistake. Since we have
isequal(0, complex(0))
it seems natural that they would both give the same result.This PR changes it so that the real argument is treated as a complex argument with imaginary part zero. So we would get identical results for the two above constructors. Feel free to discard this if the original behavior is indeed intended.
I also noticed that there are no constructors for
BareInterval
fromComplex
. This would maybe be by design though? Since in generalBareInterval
is intended to be very "bare".