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

Bug: avoid doing equality comparisons between floating expressions. #4633

Closed
ustchcs-bugfinder opened this issue Aug 13, 2020 · 0 comments
Closed

Comments

@ustchcs-bugfinder
Copy link

while (current_cost() != best_cost) {

while (current_cost() != best_cost) {

Doing equality/inequality judgement on doubles is not a best practice.

There are lots of discussions on stackoverflow.

void bdd_manager::sift_var(unsigned v) {
        unsigned lvl = m_var2level[v];
        unsigned start = lvl;
        double best_cost = current_cost();
        ...
            while (current_cost() != best_cost) {    // do equality/inequality judgement on doubles
                sift_up(--lvl);
            }
        ...
        }

Reported by: USTCHCS Analysis Toolsuite Bugfinder
(bugfinder-5.15: Avoid doing equality comparisons between floating expressions.)

NikolajBjorner added a commit that referenced this issue Aug 13, 2020
Signed-off-by: Nikolaj Bjorner <[email protected]>
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