Skip to content

Bug: Bit-wise operators should not be used where logical operators should be used. ( && should be used instead of &)  #18115

@ustchcs-bugfinder

Description

@ustchcs-bugfinder

} else if ((m00 > m11)&(m00 > m22)) {

   if (trace > 0) {
        double S = sqrt(trace + 1.0) * 2; // S=4*qw
        qx = (m21 - m12) / S;
        qy = (m02 - m20) / S;
        qz = (m10 - m01) / S;
    } else if ((m00 > m11)&(m00 > m22)) {                             //HERE!!!
        double S = sqrt(1.0 + m00 - m11 - m22) * 2; // S=4*qx
        qx = 0.25 * S;
        qy = (m01 + m10) / S;
        qz = (m02 + m20) / S;
    }

Reported by: USTCHCS Analysis Toolsuite Bugfinder
(bugfinder-5.2: Bit-wise operators should not be used where logical operators should be used. )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions