Skip to content

Commit

Permalink
Avoid a few code-scanning warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Aug 4, 2023
1 parent 94eae2c commit 5443aef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test-suite/americanoption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,7 @@ void AmericanOptionTest::testBjerksundStenslandEuropeanGreeks() {
);
europeanOption.setPricingEngine(europeanEngine);

const Real tol = 1000*QL_EPSILON;
constexpr double tol = 1000*QL_EPSILON;

BOOST_CHECK_CLOSE(europeanOption.NPV(), americanOption.NPV(), tol);
BOOST_CHECK_CLOSE(europeanOption.delta(), americanOption.delta(), tol);
Expand Down Expand Up @@ -2225,7 +2225,7 @@ void AmericanOptionTest::testSingleBjerksundStenslandGreeks() {
const Real expectedTheta = -4.22540293840206704;

const auto report = [=](Real value, Real expectedValue, const std::string& name) {
const Real tol = 1e6*QL_EPSILON;
constexpr double tol = 1e6*QL_EPSILON;
const Real error = std::abs(value-expectedValue);
if (error > tol)
REPORT_FAILURE(name, \
Expand Down
4 changes: 2 additions & 2 deletions test-suite/interpolations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,7 @@ void InterpolationTest::testChebyshevInterpolation() {
void InterpolationTest::testChebyshevInterpolationOnNodes() {
BOOST_TEST_MESSAGE("Testing Chebyshev interpolation on and around nodes...");

const Real tol = 10*QL_EPSILON;
constexpr double tol = 10*QL_EPSILON;
const auto testFct = [](Real x) { return std::sin(x);};

const Size nrNodes = 7;
Expand Down Expand Up @@ -2501,7 +2501,7 @@ void InterpolationTest::testChebyshevInterpolationUpdateY() {
Array yd({6, 4, 5, 6});
interp.updateY(yd);

const Real tol = 10*QL_EPSILON;
constexpr double tol = 10*QL_EPSILON;

for (Size i=0; i < y.size(); ++i) {
const Real expected = yd[i];
Expand Down

0 comments on commit 5443aef

Please sign in to comment.