Home | History | Annotate | Download | only in math

Lines Matching defs:half

44  * half-float
57 class half {
85 CONSTEXPR half(float v) noexcept : mBits(ftoh(v)) { }
93 friend class std::numeric_limits<half>;
94 friend CONSTEXPR half operator"" _hf(long double v);
97 explicit constexpr half(Binary, uint16_t bits) noexcept : mBits(bits) { }
103 inline CONSTEXPR half::fp16 half::ftoh(float v) noexcept {
131 inline CONSTEXPR float half::htof(half::fp16 in) noexcept {
139 // TODO: denormal half float, treat as zero for now
153 inline CONSTEXPR android::half operator"" _hf(long double v) {
154 return android::half(android::half::binary, android::half::ftoh(static_cast<float>(v)).bits);
161 template<> struct is_floating_point<android::half> : public std::true_type {};
164 class numeric_limits<android::half> {
166 typedef android::half type;
193 inline static constexpr type round_error() noexcept { return android::half(android::half::binary, 0x3800); }
194 inline static constexpr type min() noexcept { return android::half(android::half::binary, 0x0400); }
195 inline static constexpr type max() noexcept { return android::half(android::half::binary, 0x7bff); }
196 inline static constexpr type lowest() noexcept { return android::half(android::half::binary, 0xfbff); }
197 inline static constexpr type epsilon() noexcept { return android::half(android::half::binary, 0x1400); }
198 inline static constexpr type infinity() noexcept { return android::half(android::half::binary, 0x7c00); }
199 inline static constexpr type quiet_NaN() noexcept { return android::half(android::half::binary, 0x7fff); }
200 inline static constexpr type denorm_min() noexcept { return android::half(android::half::binary, 0x0001); }
201 inline static constexpr type signaling_NaN() noexcept { return android::half(android::half::binary, 0x7dff); }