Skip to content

Refactor double comparison operators #121

Description

@thomaskeller79

Currently we have functions for doubleIsEqual, doubleIsGreater, doubleIsGreaterOrEqual, ... that are largely unconnected. Instead, we want to have functions that guarantee for two doubles x and y that either x==y, xy but such that we use the operators < and > as often as possible. For instance, we could implement doubleIsGreater as:

bool doubleIsGreater(double x, double y) {
    return x > y && utils::doubleIsEqual(x, y);
}

Since these functions are called everywhere in the code, we have to make sure that we evaluate the change carefully.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions