Modifies exp() and pow() and specs behaviour of z^inf and inf^z.#25
Closed
harrysarson wants to merge 2 commits intorawify:masterfrom
Closed
Modifies exp() and pow() and specs behaviour of z^inf and inf^z.#25harrysarson wants to merge 2 commits intorawify:masterfrom
harrysarson wants to merge 2 commits intorawify:masterfrom
Conversation
Previous behaviour was inconsistant and was not tested for. This commit ensures that z^inf and inf^z return reasonable and consistant values. See rawify#24 for the dicussion on the behaviour which can be summaried as: z ^ Infinity === NaN Infinity ^ z === Infinity if Im(z) === 0 and Re(z) > 0 Infinity ^ z === 0 if Re(z) < 0 Infinity ^ 0 === 1 Infinity ^ z === NaN otherwise
harrysarson
commented
Mar 15, 2018
| if (!this.isFinite()) { | ||
| return z['re'] < 0 | ||
| ? Complex['ZERO'] | ||
| : z['im'] === 0 && z['re'] > 0 // should we epsilon ball here |
Contributor
Author
There was a problem hiding this comment.
Should the imaginary part of z be compared exactly to 0 here or should Complex['EPSILON'] be used?
Contributor
Author
|
@infusion could you take a look? |
Contributor
Author
|
@infusion I have solved the merge conflicts, would it be possible to review this? |
Contributor
Author
|
@infusion any updates? |
Collaborator
|
Sorry, github autoclosed this issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previous behaviour was inconsistant and was not tested for. This
commit ensures that z^inf and inf^z return reasonable and consistant
values.
See #24 for the dicussion on the behaviour which can be summaried as: