|
|
constexpr | fp16 () noexcept=default |
| | Default-initialize storage without setting its bits; value-initialization zeroes it.
|
|
constexpr | fp16 (fp16 const &) noexcept=default |
| | Copy the native sixteen-bit representation.
|
|
constexpr | fp16 (fp16 &&) noexcept=default |
| | Copy the native representation; the source retains its bits.
|
|
constexpr | fp16 (float value) noexcept |
| | Round a binary32 value to this format, ties to even.
|
|
constexpr | fp16 (_Float16 content) noexcept |
| | Copy native storage without a numerical conversion.
|
|
constexpr | operator float (this fp16 self) noexcept |
| | Decode to binary32; finite values are exact and signaling NaNs are quieted.
|
|
constexpr | operator _Float16 (this fp16 self) noexcept |
| | Return native storage without rounding or normalizing NaN payloads.
|
|
constexpr fp16 & | operator= (fp16 const &) noexcept=default |
| | Copy the native representation, replacing all previous bits.
|
|
constexpr fp16 & | operator= (fp16 &&) noexcept=default |
| | Copy the native representation, leaving the source unchanged.
|
|
constexpr uint16_t | to_bits (this fp16 self) noexcept |
| | Return the exact sixteen representation bits.
|
|
|
constexpr bool | operator== (fp16 x, fp16 y) noexcept |
| | Compare decoded values for equality; signed zeros compare equal and NaNs do not.
|
|
constexpr bool | operator!= (fp16 x, fp16 y) noexcept |
| | Compare decoded values for inequality; a NaN operand makes the result true.
|
|
constexpr std::partial_ordering | operator<=> (fp16 x, fp16 y) noexcept |
| | Compare decoded values; NaNs are unordered and signed zeros equivalent.
|
|
constexpr bool | operator< (fp16 x, fp16 y) noexcept |
| | Return whether the decoded left value is less; false for NaN operands.
|
|
constexpr bool | operator<= (fp16 x, fp16 y) noexcept |
| | Return whether the decoded left value is at most the right; false for NaN operands.
|
|
constexpr bool | operator> (fp16 x, fp16 y) noexcept |
| | Return whether the decoded left value is greater; false for NaN operands.
|
|
constexpr bool | operator>= (fp16 x, fp16 y) noexcept |
| | Return whether the decoded left value is at least the right; false for NaN operands.
|
|
constexpr void | swap (fp16 &x, fp16 &y) noexcept |
| | Exchange native representations, including signed zeros and NaN payloads.
|
Two-byte binary16 storage with environment-independent binary32 ties-to-even conversion. Conversion from float handles subnormals and overflow explicitly. Native-half interoperability is available only where the target supports that type. Native import and bit factories preserve representation without rounding. This is a storage/conversion type, not an FTZ arithmetic policy.
void common_utilities() {
auto first = "vector"_ss;
auto second = "vector"_ss;
check(first == second && first.data() == second.data());
check(std::hash<static_string>{}(first) == std::hash<static_string>{}(second));
if (owned) check(std::string_view(owned.get()) == "vector");
check(static_cast<float>(half) == 1.5f);
}
Definition at line 34 of file native.numerics.ccm.