Skip to content

Commit

Permalink
fix bug of a failed test on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
guuzaa committed Mar 23, 2024
1 parent 6f68832 commit 815d91c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/include/int128_have_intrinstic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,15 @@ constexpr int128 operator-(int128 lhs, int128 rhs) { return static_cast<__int128

inline int128 operator*(int128 lhs, int128 rhs) { return static_cast<__int128>(lhs) * static_cast<__int128>(rhs); }

inline int128 operator/(int128 lhs, int128 rhs) { return static_cast<__int128>(lhs) / static_cast<__int128>(rhs); }
inline int128 operator/(int128 lhs, int128 rhs) {
assert(rhs != 0);
return static_cast<__int128>(lhs) / static_cast<__int128>(rhs);
}

inline int128 operator%(int128 lhs, int128 rhs) { return static_cast<__int128>(lhs) % static_cast<__int128>(rhs); }
inline int128 operator%(int128 lhs, int128 rhs) {
assert(rhs != 0);
return static_cast<__int128>(lhs) % static_cast<__int128>(rhs);
}

inline int128 int128::operator++(int) {
int128 tmp(*this);
Expand Down
2 changes: 1 addition & 1 deletion src/numbers/int128.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int128 operator%(int128 lhs, int128 rhs) {
}
return make_int128(int128_internal::BitCastToSigned(uint128_high64(remainder)), uint128_low64(remainder));
}
#endif // NUMBERS_HAVE_INTRINSTIC_INT128
#endif // ! NUMBERS_HAVE_INTRINSTIC_INT128

std::ostream &operator<<(std::ostream &os, int128 v) {
std::ios_base::fmtflags flags = os.flags();
Expand Down

0 comments on commit 815d91c

Please sign in to comment.