Skip to content

Commit

Permalink
Fixed constexpr significant bits value for double
Browse files Browse the repository at this point in the history
Renamed variable for clarity.
  • Loading branch information
oleksandr-pavlyk committed Sep 6, 2023
1 parent 87d1c13 commit fed0e9b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ template <typename argT, typename resT> struct SqrtFunctor

int get_normal_scale_double(const double &v) const
{
constexpr int float_significant_bits = 53;
constexpr int double_significant_bits = 52;
constexpr std::uint64_t exponent_mask = 0x7ff;
constexpr int exponent_bias = 1023;
const int scale = static_cast<int>(
(sycl::bit_cast<std::uint64_t>(v) >> float_significant_bits) &
(sycl::bit_cast<std::uint64_t>(v) >> double_significant_bits) &
exponent_mask);
return scale - exponent_bias;
}
Expand Down

0 comments on commit fed0e9b

Please sign in to comment.