Fix build on Xcode 14 (#116)

* Fix build on Xcode 14

* Style fixes
This commit is contained in:
Angelos Katharopoulos
2023-12-10 06:58:52 -08:00
committed by GitHub
parent ef7b8756c0
commit 600db7d754
4 changed files with 23 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ struct Remainder {
template <typename T> T operator()(T x, T y) { return x % y; }
template <> float operator()(float x, float y) { return fmod(x, y); }
template <> half operator()(half x, half y) { return fmod(x, y); }
template <> bfloat operator()(bfloat x, bfloat y) { return fmod(x, y); }
template <> bfloat16_t operator()(bfloat16_t x, bfloat16_t y) { return fmod(x, y); }
};
struct Equal {

View File

@@ -112,5 +112,7 @@ constexpr complex64_t operator*(complex64_t a, complex64_t b) {
}
constexpr complex64_t operator%(complex64_t a, complex64_t b) {
return {fmod(a.real, b.real), fmod(a.imag, b.imag)};
auto real = a.real - (b.real * static_cast<int64_t>(a.real / b.real));
auto imag = a.imag - (b.imag * static_cast<int64_t>(a.imag / b.imag));
return {real, imag};
}