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

Complex utility functions if imaginary part is 0 #92

Closed
axkr opened this issue May 19, 2020 · 1 comment
Closed

Complex utility functions if imaginary part is 0 #92

axkr opened this issue May 19, 2020 · 1 comment

Comments

@axkr
Copy link
Contributor

axkr commented May 19, 2020

Are there some similar utility functions for the Complex number type as in the Guava DoubleMath utility class, if the imaginary part is 0.0?

isMathematicalInteger
https://github.com/google/guava/blob/45958948bea8f7aaf38c1a3dd200ce0263c0bcfa/android/guava/src/com/google/common/math/DoubleMath.java#L286

roundToInt:
https://github.com/google/guava/blob/45958948bea8f7aaf38c1a3dd200ce0263c0bcfa/android/guava/src/com/google/common/math/DoubleMath.java#L131

@maisonobe
Copy link
Contributor

For questions, please use the new forum at https://forum.orekit.org/c/hipparchus-usage/.

There are not (yet) similar functions in Complex. We have added quite a large number of functions so Complex now implements the new CalculusFieldElement interface, for the sake of solving issue #67. The closest function to your second need would be round, but it is in the RealFieldElement interface, not in the CalculusFieldElement class. We could move it up as explained in the comment I wrote here.

We could implement the first method directly in Complex, without reference to any higher level interface.

maisonobe added a commit that referenced this issue May 29, 2020
maisonobe added a commit that referenced this issue Jun 2, 2020
This should complete the changes to allow differentiating on the complex
field.

Fixes #92
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

No branches or pull requests

2 participants