A false negative for RSPEC-2164 document case

Hi, I used sonarqube and sonar-scanner to test the document case of RSPEC-2164, but no related warnings. The code example is below:

float a = 16777216.0f;
float b = 1.0f;
float c = a + b; // Noncompliant; yields 1.6777216E7 not 1.6777217E7
double d = a + b; // Noncompliant; addition is still between 2 floats

Version: Latest

Hey there.

This rule isn’t active by default in SonarQube – have you activated it in a Quality Profile which you’ve applied to the project? I can trigger the issue using your code sample.

Got it, thanks for your reply.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.