Skip to content

Avoid doing equality comparisons between floating expressions.(llvm-project/llvm/tools/llvm-xray/xray-color-helper.cpp:line 98 and 105) #46426

Open
@llvmbot

Description

@llvmbot
Bugzilla Link 47082
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @RKSimon

Extended Description

Avoid doing equality comparisons between floating expressions.

commit e3546c7

llvm-project/llvm/tools/llvm-xray/xray-color-helper.cpp:line 98 and 105

95	  double C = Scaled[Max] - Scaled[Min];
96	
97	  double HPrime =
98	      (C == 0) ? 0 : (Scaled[(Max + 1) % 3] - Scaled[(Max + 2) % 3]) / C;
99	  HPrime = HPrime + 2.0 * Max;

100
101 double H = (HPrime < 0) ? (HPrime + 6.0) * 60
102 : HPrime * 60; // Scale to between 0 and 360
103 double V = Scaled[Max];
104
105 double S = (V == 0.0) ? 0.0 : C / V;
106
107 return std::make_tuple(H, S, V);
108 }

Reported by: Ustchcs Toolsets Bugfinder
(bugfinder-5.15: Avoid doing equality comparisons between floating expressions.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaxray

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions