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

Define interface Comparable method compareTo as "canonical order" in more FieldElement derived classes #274

Closed
axkr opened this issue Sep 23, 2023 · 0 comments
Labels
core enhancement field Anything related to interface CalculusField

Comments

@axkr
Copy link
Contributor

axkr commented Sep 23, 2023

A Comparable interface should be established for a "canonical order" for more FieldElement derived classes.

The Binary64method already has a Comparable interface:

For the Complexclass I would like to suggest:

public int compareTo(final Complex o) {
    int c = Double.compare(this.getReal(), o.getReal());
    if (c != 0) {
      return c;
    }
    return Double.compare(this.getImaginary(), o.getImaginary());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement field Anything related to interface CalculusField
Projects
None yet
Development

No branches or pull requests

3 participants