Skip to content

Commit 1f597e4

Browse files
committed
Minor improvements
Signed-off-by: Ian <[email protected]>
1 parent 5aaae53 commit 1f597e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/ccmath/internal/types/dyadic_float.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ namespace ccm::types
220220
// also raise FE_OVERFLOW and set ERANGE is debatable.
221221
// TODO: Check what MSVC does for this case to match them when compiling with MSVC.
222222
// This behavior matches Clang.
223-
if (ShouldSignalExceptions && support::fp::FPBits<T>(r).is_inf()) { support::fenv::set_errno_if_required(ERANGE); }
223+
if constexpr (ShouldSignalExceptions && support::fp::FPBits<T>(r).is_inf()) { support::fenv::set_errno_if_required(ERANGE); }
224224

225225
return r;
226226
}
@@ -291,7 +291,7 @@ namespace ccm::types
291291
// "tininess" before or after rounding for base-2 formats, as long as
292292
// the same choice is made for all operations.
293293
// Our choice to check after rounding might not be the same as the hardware's.
294-
if (ShouldSignalExceptions && round_and_sticky)
294+
if constexpr (ShouldSignalExceptions && round_and_sticky)
295295
{
296296
support::fenv::set_errno_if_required(ERANGE);
297297
support::fenv::raise_except_if_required(FE_UNDERFLOW);
@@ -343,7 +343,7 @@ namespace ccm::types
343343
template <typename T, typename = std::enable_if_t<std::is_floating_point_v<T> && (support::fp::FPBits<T>::fraction_length < Bits), void>>
344344
explicit constexpr operator T() const
345345
{
346-
return as<T, /*ShouldSignalExceptions=*/false>();
346+
return as<T, false>();
347347
}
348348

349349
constexpr mantissa_type as_mantissa_type() const

0 commit comments

Comments
 (0)