Skip to content

Commit

Permalink
Address inspect tool
Browse files Browse the repository at this point in the history
- missing includes
- prevent max/min being expanded as macros

Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
  • Loading branch information
SAtacker committed Dec 17, 2024
1 parent 520f161 commit 2d00568
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <hpx/parallel/util/loop.hpp>

#include <cstddef>
#include <cstring>
#include <limits>
#include <type_traits>
#include <utility>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <cmath>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <vector>

namespace hpx::parallel::detail::rfa {
template <typename F>
Expand Down Expand Up @@ -365,7 +367,7 @@ namespace hpx::parallel::detail::rfa {
else
{
std::frexp(x, &exp);
return std::max((MAX_EXP - exp) / BIN_WIDTH, MAXINDEX);
return (std::max)((MAX_EXP - exp) / BIN_WIDTH, MAXINDEX);
}
}
return ((MAX_EXP + EXP_BIAS) - exp) / BIN_WIDTH;
Expand Down Expand Up @@ -564,8 +566,8 @@ namespace hpx::parallel::detail::rfa {
{
scale_down = std::ldexp(0.5, 1 - (2 * MANT_DIG - BIN_WIDTH));
scale_up = std::ldexp(0.5, 1 + (2 * MANT_DIG - BIN_WIDTH));
scaled = std::max(
std::min(FOLD, (3 * MANT_DIG) / BIN_WIDTH - X_index), 0);
scaled = (std::max)(
(std::min)(FOLD, (3 * MANT_DIG) / BIN_WIDTH - X_index), 0);
if (X_index == 0)
{
Y += carry(0) * ((bins[0] / 6.0) * scale_down * EXPANSION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <limits>
#include <numeric>
#include <random>
#include <string>
#include <vector>

#include "test_utils.hpp"
Expand All @@ -27,8 +28,8 @@ int seed = std::random_device{}();
std::mt19937 gen(seed);

template <typename T>
T get_rand(
T LO = std::numeric_limits<T>::min(), T HI = std::numeric_limits<T>::max())
T get_rand(T LO = (std::numeric_limits<T>::min)(),
T HI = (std::numeric_limits<T>::max)())
{
return LO +
static_cast<T>(std::rand()) / (static_cast<T>(RAND_MAX / (HI - LO)));
Expand Down

0 comments on commit 2d00568

Please sign in to comment.