Skip to content

Commit

Permalink
Explicit return type for double expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-differentiation-dev authored Nov 18, 2024
1 parent 529c720 commit 63dcd6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ql/math/randomnumbers/zigguratgaussianrng.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ namespace QuantLib {
// This saves us generating a whole extra random number, while the added
// precision of using 64 bits for double does not buy us much.
std::uint64_t randomU64 = uint64Generator_.nextInt64();
auto u = 2.0 * (Real(randomU64 >> 11) + 0.5) * (1.0 / Real(1ULL << 53)) - 1.0;
Real u = 2.0 * (Real(randomU64 >> 11) + 0.5) * (1.0 / Real(1ULL << 53)) - 1.0;
auto i = (int)(randomU64 & 0xff);

auto x = u * normX(i);
Real x = u * normX(i);

if (std::abs(x) < normX(i + 1)) {
return x;
Expand Down

0 comments on commit 63dcd6a

Please sign in to comment.