From fed0e9bfca4bb85e4ff471a89941fb99bcd5d658 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Thu, 31 Aug 2023 00:55:28 -0500 Subject: [PATCH] Fixed constexpr significant bits value for double Renamed variable for clarity. --- .../libtensor/include/kernels/elementwise_functions/sqrt.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpctl/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp b/dpctl/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp index 808e82539e..9b9fa95061 100644 --- a/dpctl/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp +++ b/dpctl/tensor/libtensor/include/kernels/elementwise_functions/sqrt.hpp @@ -150,11 +150,11 @@ template 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( - (sycl::bit_cast(v) >> float_significant_bits) & + (sycl::bit_cast(v) >> double_significant_bits) & exponent_mask); return scale - exponent_bias; }