Skip to content

Commit adc6dca

Browse files
authored
Merge pull request #858 from mborland/warnings
Fix warning 4146 and 4244 in ccmath
2 parents aa25b04 + 94201a8 commit adc6dca

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

include/boost/math/ccmath/isinf.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@
1414
namespace boost::math::ccmath {
1515

1616
template <typename T>
17-
inline constexpr bool isinf(T x)
17+
constexpr bool isinf(T x) noexcept
1818
{
1919
if(BOOST_MATH_IS_CONSTANT_EVALUATED(x))
2020
{
21-
return x == std::numeric_limits<T>::infinity() || -x == std::numeric_limits<T>::infinity();
21+
if constexpr (std::numeric_limits<T>::is_signed)
22+
{
23+
return x == std::numeric_limits<T>::infinity() || -x == std::numeric_limits<T>::infinity();
24+
}
25+
else
26+
{
27+
return x == std::numeric_limits<T>::infinity();
28+
}
2229
}
2330
else
2431
{

include/boost/math/ccmath/logb.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ inline constexpr T logb_impl(T arg) noexcept
2929
int exp = 0;
3030
boost::math::ccmath::frexp(arg, &exp);
3131

32-
return exp - 1;
32+
return static_cast<T>(exp - 1);
3333
}
3434

3535
} // Namespace detail

0 commit comments

Comments
 (0)