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.
#281 was one way to address #273, this is another:
real
,imag
(LikeN
which is more performant)real
,imag
, andconj
for expressions with free symbolsIssue #273 points out that symbolic variables are subtypes of Number, not Real, so the definition of
real(x) = x
isn't correct. That seems right. Since there isn't any underlying support for this functionality in libsymengine there isn't a means to define an unevaluatedreal(x)
orimag(x)
. So it seems like an error is appropriate. (Alreadyimag(x)
was erroring, though with an incorrect call toInexactError
, likely my mistake awhile ago.) As this change would be breaking, this PR sets up a deprecation and adds suggested code (commented out) for when the breaking release is ready.If #292 gets merged first, there are few instances of
Basic(0)
that could be replaced byZERO
and a few constants to be added to the enumeration inRealConstants
. So I'd update this PR.