Skip to content

Commit

Permalink
Merge pull request #1393 from IntelPython/fix-typo-in-sqrt
Browse files Browse the repository at this point in the history
Fixed constexpr significant bits value for double
  • Loading branch information
oleksandr-pavlyk authored Sep 6, 2023
2 parents 87d1c13 + fed0e9b commit a91fc55
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 a91fc55

Please sign in to comment.