LGTM: Eliminate float-to-double overflow warning
LGTM complains if this calculation is done from inside the sqrt() call because it sees the explicit cast to float and assumes that sqrt() is intended to take a double. By adding an intermediate step it should be clear to LGTM that the float version of sqrt is intended.
This commit is contained in:
@@ -291,7 +291,8 @@ void MeshGrid::CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxG
|
||||
else
|
||||
fAreaElem = fArea / float(_ulCtElements);
|
||||
|
||||
fGridLen = sqrt(fAreaElem * float(ulCtGrid));
|
||||
float fRepresentativeArea = fAreaElem * static_cast<float>(ulCtGrid);
|
||||
fGridLen = sqrt(fRepresentativeArea);
|
||||
}
|
||||
|
||||
if (fGridLen > 0) {
|
||||
|
||||
Reference in New Issue
Block a user