Skip to content

Commit 97af831

Browse files
Saurav AgarwalSaurav Agarwal
authored andcommitted
use sqrt for older gcc
1 parent a531512 commit 97af831

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cppsrc/core/include/CoverageControl/constants.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ namespace CoverageControl {
4848
double const kEps = 1e-10; /*!< Epsilon for double comparison */
4949
float const kEpsf = 1e-6f; /*!< Epsilon for float comparison */
5050
double const kLargeEps = 1e-4; /*!< Large epsilon for double comparison */
51-
double const kSqrt2 = std::sqrt(2); /*!< Square root of 2 */
52-
double const kOneBySqrt2 = 1. / std::sqrt(2); /*!< 1 by square root of 2 */
53-
float const kOneBySqrt2f = 1.f / sqrtf(2.f); /*!< 1 by square root of 2 */
51+
double const kSqrt2 = std::sqrt(2.); /*!< Square root of 2 */
52+
double const kOneBySqrt2 = 1.0 / kSqrt2; /*!< 1 by square root of 2 */
53+
float const kOneBySqrt2f = 1.0f / std::sqrt(2.0f); /*!< 1 by square root of 2 */
5454
double const kInfD =
5555
std::numeric_limits<double>::infinity(); /*!< Infinity for double */
5656
constexpr auto kMaxPrecision{std::numeric_limits<long double>::digits10 +

cppsrc/core/src/world_idf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void WorldIDF::GenerateMapCuda(float const resolution, float const truncation,
119119
host_dists[i].sigma_y = static_cast<float>(sigma.y());
120120
float rho = static_cast<float>(normal_distributions_[i].GetRho());
121121
host_dists[i].rho = rho;
122-
host_dists[i].sqrt_one_minus_rho_squared = std::sqrtf(1. - rho * rho);
122+
host_dists[i].sqrt_one_minus_rho_squared = std::sqrt(1. - rho * rho);
123123
host_dists[i].scale =
124124
static_cast<float>(normal_distributions_[i].GetScale());
125125
}

0 commit comments

Comments
 (0)