Skip to content

Commit

Permalink
Update half.h (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinxc authored Dec 27, 2023
1 parent 5843d46 commit 0b7a59d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libspu/core/half.h
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ template <std::float_round_style R, bool E, bool I, typename T>
T half2int(unsigned int value) {
unsigned int abs = value & 0x7FFF;
if (abs >= 0x7C00) {
raise(FE_INVALID);
detail::raise(FE_INVALID);
return (value & 0x8000) ? std::numeric_limits<T>::min()
: std::numeric_limits<T>::max();
}
Expand All @@ -1712,9 +1712,9 @@ T half2int(unsigned int value) {
(std::numeric_limits<T>::digits < 16 &&
((value & 0x8000) ? (-i < std::numeric_limits<T>::min())
: (i > std::numeric_limits<T>::max()))))
raise(FE_INVALID);
detail::raise(FE_INVALID);
else if (I && exp > 0 && (m & ((1 << exp) - 1)))
raise(FE_INEXACT);
detail::raise(FE_INEXACT);
return static_cast<T>((value & 0x8000) ? -i : i);
}

Expand Down

0 comments on commit 0b7a59d

Please sign in to comment.