Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifies exp() and pow() and specs behaviour of z^inf and inf^z. #25

Closed
wants to merge 2 commits into from

Conversation

harrysarson
Copy link
Contributor

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:

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

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
if (!this.isFinite()) {
return z['re'] < 0
? Complex['ZERO']
: z['im'] === 0 && z['re'] > 0 // should we epsilon ball here
Copy link
Contributor Author

@harrysarson harrysarson Mar 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the imaginary part of z be compared exactly to 0 here or should Complex['EPSILON'] be used?

@harrysarson
Copy link
Contributor Author

@infusion could you take a look?

@harrysarson
Copy link
Contributor Author

@infusion I have solved the merge conflicts, would it be possible to review this?

@harrysarson
Copy link
Contributor Author

@infusion any updates?

@infusion
Copy link
Collaborator

infusion commented Oct 4, 2024

Sorry, github autoclosed this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants