We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49febca commit de7b4eaCopy full SHA for de7b4ea
libc/src/__support/FPUtil/bfloat16.h
@@ -57,6 +57,13 @@ struct BFloat16 {
57
uint32_t x_bits = static_cast<uint32_t>(bits) << 16U;
58
return cpp::bit_cast<float>(x_bits);
59
}
60
+
61
+ LIBC_INLINE constexpr BFloat16 operator-() const {
62
+ fputil::FPBits<bfloat16> result(*this);
63
+ result.set_sign(result.is_pos() ? Sign::NEG : Sign::POS);
64
+ return result.get_val();
65
+ }
66
67
}; // struct BFloat16
68
69
} // namespace fputil
0 commit comments