Debian Codegraph @

src/binary16.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 #[cfg(all(feature = "serde", feature = "alloc"))]
2 #[allow(unused_imports)]
3 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::ToStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/ToString#;
4 #[cfg(feature = "bytemuck")]
5 use bytemuckrust-analyzer cargo bytemuck 1.4.1 crate/::{Podrust-analyzer cargo bytemuck 1.4.1 pod/Pod#, Zeroablerust-analyzer cargo bytemuck 1.4.1 zeroable/Zeroable#};
6 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::{
7 cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#,
8 iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/::{Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product#, Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#},
9 numrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/::FpCategoryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#,
10 opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#, AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#, Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#, DivAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#, Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#, MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#, Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#, Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#, RemAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#, Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#, SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#},
11 };
12 #[cfg(not(target_arch = "spirv"))]
13 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::{
14 fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::{
15 Binaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Binary#, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#, Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#, Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#, Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#, LowerExprust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/LowerExp#, LowerHexrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/LowerHex#, Octalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Octal#, UpperExprust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/UpperExp#, UpperHexrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/UpperHex#,
16 },
17 numrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/::ParseFloatErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/dec2flt/ParseFloatError#,
18 strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#,
19 };
20 #[cfg(feature = "serde")]
21 use serderust-analyzer cargo serde 1.0.219 crate/::{Deserializerust-analyzer cargo serde 1.0.219 de/Deserialize#, Serializerust-analyzer cargo serde 1.0.219 ser/Serialize#};
22 use zerocopyrust-analyzer cargo zerocopy 0.8.26 crate/::{FromBytesrust-analyzer cargo zerocopy 0.8.26 FromBytes#, Immutablerust-analyzer cargo zerocopy 0.8.26 Immutable#, IntoBytesrust-analyzer cargo zerocopy 0.8.26 IntoBytes#, KnownLayoutrust-analyzer cargo zerocopy 0.8.26 KnownLayout#};
23
24 pub(craterust-analyzer cargo half 2.7.1 crate/) mod archrust-analyzer cargo half 2.7.1 binary16/arch/;
25
26 /// A 16-bit floating point type implementing the IEEE 754-2008 standard [`binary16`] a.k.a "half"
27 /// format.
28 ///
29 /// This 16-bit floating point type is intended for efficient storage where the full range and
30 /// precision of a larger floating point value is not required.
31 ///
32 /// [`binary16`]: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
33 #[allow(non_camel_case_types)]
34 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
35 #[repr(transparent)]
36 #[cfg_attr(feature = "serde", derive(Serializerust-analyzer cargo serde_derive 1.0.219 Serialize:))]
37 #[cfg_attr(
38 feature = "rkyv",
39 derive(rkyvrust-analyzer cargo rkyv 0.8.0 crate/::Archiverust-analyzer cargo rkyv_derive 0.8.0 Archive:, rkyvrust-analyzer cargo rkyv 0.8.0 crate/::Serializerust-analyzer cargo rkyv_derive 0.8.0 Serialize:, rkyvrust-analyzer cargo rkyv 0.8.0 crate/::Deserializerust-analyzer cargo rkyv_derive 0.8.0 Deserialize:)
40 )]
41 #[cfg_attr(feature = "rkyv", rkyv(resolver = F16Resolver))]
42 #[cfg_attr(feature = "bytemuck", derive(Zeroablerust-analyzer cargo bytemuck_derive 1.8.1 Zeroable:, Podrust-analyzer cargo bytemuck_derive 1.8.1 Pod:))]
43 #[cfg_attr(kani, derive(kani::Arbitrary))]
44 #[cfg_attr(feature = "arbitrary", derive(arbitraryrust-analyzer cargo arbitrary 1.4.1 crate/::Arbitraryrust-analyzer cargo derive_arbitrary 1.4.1 Arbitrary:))]
45 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(FromBytesrust-analyzer cargo zerocopy-derive 0.8.26 FromBytes:, Immutablerust-analyzer cargo zerocopy-derive 0.8.26 Immutable:, IntoBytesrust-analyzer cargo zerocopy-derive 0.8.26 IntoBytes:, KnownLayoutrust-analyzer cargo zerocopy-derive 0.8.26 KnownLayout:)]
46 pub struct f16rust-analyzer cargo half 2.7.1 binary16/f16#(u16);
47
48 impl f16rust-analyzer cargo half 2.7.1 binary16/f16# {
49 /// Constructs a 16-bit floating point value from the raw bits.
50 #[inline]
51 #[must_use]
52 pub const fn from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(bits: u16) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
53 f16rust-analyzer cargo half 2.7.1 binary16/f16#(bits)
54 }
55
56 /// Constructs a 16-bit floating point value from a 32-bit floating point value.
57 ///
58 /// This operation is lossy. If the 32-bit value is to large to fit in 16-bits, ±∞ will result.
59 /// NaN values are preserved. 32-bit subnormal values are too tiny to be represented in 16-bits
60 /// and result in ±0. Exponents that underflow the minimum 16-bit exponent will result in 16-bit
61 /// subnormals or ±0. All other values are truncated and rounded to the nearest representable
62 /// 16-bit value.
63 #[inline]
64 #[must_use]
65 pub fn from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(value: f32) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
66 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::f32_to_f16rust-analyzer cargo half 2.7.1 binary16/arch/f32_to_f16().(value))
67 }
68
69 /// Constructs a 16-bit floating point value from a 32-bit floating point value.
70 ///
71 /// This function is identical to [`from_f32`][Self::from_f32] except it never uses hardware
72 /// intrinsics, which allows it to be `const`. [`from_f32`][Self::from_f32] should be preferred
73 /// in any non-`const` context.
74 ///
75 /// This operation is lossy. If the 32-bit value is to large to fit in 16-bits, ±∞ will result.
76 /// NaN values are preserved. 32-bit subnormal values are too tiny to be represented in 16-bits
77 /// and result in ±0. Exponents that underflow the minimum 16-bit exponent will result in 16-bit
78 /// subnormals or ±0. All other values are truncated and rounded to the nearest representable
79 /// 16-bit value.
80 #[inline]
81 #[must_use]
82 pub const fn from_f32_construst-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32_const().(value: f32) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
83 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::f32_to_f16_fallbackrust-analyzer cargo half 2.7.1 binary16/arch/f32_to_f16_fallback().(value))
84 }
85
86 /// Constructs a 16-bit floating point value from a 64-bit floating point value.
87 ///
88 /// This operation is lossy. If the 64-bit value is to large to fit in 16-bits, ±∞ will result.
89 /// NaN values are preserved. 64-bit subnormal values are too tiny to be represented in 16-bits
90 /// and result in ±0. Exponents that underflow the minimum 16-bit exponent will result in 16-bit
91 /// subnormals or ±0. All other values are truncated and rounded to the nearest representable
92 /// 16-bit value.
93 #[inline]
94 #[must_use]
95 pub fn from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(value: f64) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
96 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::f64_to_f16rust-analyzer cargo half 2.7.1 binary16/arch/f64_to_f16().(value))
97 }
98
99 /// Constructs a 16-bit floating point value from a 64-bit floating point value.
100 ///
101 /// This function is identical to [`from_f64`][Self::from_f64] except it never uses hardware
102 /// intrinsics, which allows it to be `const`. [`from_f64`][Self::from_f64] should be preferred
103 /// in any non-`const` context.
104 ///
105 /// This operation is lossy. If the 64-bit value is to large to fit in 16-bits, ±∞ will result.
106 /// NaN values are preserved. 64-bit subnormal values are too tiny to be represented in 16-bits
107 /// and result in ±0. Exponents that underflow the minimum 16-bit exponent will result in 16-bit
108 /// subnormals or ±0. All other values are truncated and rounded to the nearest representable
109 /// 16-bit value.
110 #[inline]
111 #[must_use]
112 pub const fn from_f64_construst-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64_const().(value: f64) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
113 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::f64_to_f16_fallbackrust-analyzer cargo half 2.7.1 binary16/arch/f64_to_f16_fallback().(value))
114 }
115
116 /// Converts a [`struct@f16`] into the underlying bit representation.
117 #[inline]
118 #[must_use]
119 pub const fn to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(self) -> u16 {
120 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.
121 }
122
123 /// Returns the memory representation of the underlying bit representation as a byte array in
124 /// little-endian byte order.
125 ///
126 /// # Examples
127 ///
128 /// ```rust
129 /// # use half::prelude::*;
130 /// let bytes = f16::from_f32(12.5).to_le_bytes();
131 /// assert_eq!(bytes, [0x40, 0x4A]);
132 /// ```
133 #[inline]
134 #[must_use]
135 pub const fn to_le_bytesrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_le_bytes().(self) -> [u8; 2] {
136 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0..to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_le_bytes().()
137 }
138
139 /// Returns the memory representation of the underlying bit representation as a byte array in
140 /// big-endian (network) byte order.
141 ///
142 /// # Examples
143 ///
144 /// ```rust
145 /// # use half::prelude::*;
146 /// let bytes = f16::from_f32(12.5).to_be_bytes();
147 /// assert_eq!(bytes, [0x4A, 0x40]);
148 /// ```
149 #[inline]
150 #[must_use]
151 pub const fn to_be_bytesrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_be_bytes().(self) -> [u8; 2] {
152 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0..to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_be_bytes().()
153 }
154
155 /// Returns the memory representation of the underlying bit representation as a byte array in
156 /// native byte order.
157 ///
158 /// As the target platform's native endianness is used, portable code should use
159 /// [`to_be_bytes`][Self::to_be_bytes] or [`to_le_bytes`][Self::to_le_bytes], as appropriate,
160 /// instead.
161 ///
162 /// # Examples
163 ///
164 /// ```rust
165 /// # use half::prelude::*;
166 /// let bytes = f16::from_f32(12.5).to_ne_bytes();
167 /// assert_eq!(bytes, if cfg!(target_endian = "big") {
168 /// [0x4A, 0x40]
169 /// } else {
170 /// [0x40, 0x4A]
171 /// });
172 /// ```
173 #[inline]
174 #[must_use]
175 pub const fn to_ne_bytesrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_ne_bytes().(self) -> [u8; 2] {
176 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0..to_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_ne_bytes().()
177 }
178
179 /// Creates a floating point value from its representation as a byte array in little endian.
180 ///
181 /// # Examples
182 ///
183 /// ```rust
184 /// # use half::prelude::*;
185 /// let value = f16::from_le_bytes([0x40, 0x4A]);
186 /// assert_eq!(value, f16::from_f32(12.5));
187 /// ```
188 #[inline]
189 #[must_use]
190 pub const fn from_le_bytesrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_le_bytes().(bytes: [u8; 2]) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
191 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(u16::from_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]from_le_bytes().(bytes))
192 }
193
194 /// Creates a floating point value from its representation as a byte array in big endian.
195 ///
196 /// # Examples
197 ///
198 /// ```rust
199 /// # use half::prelude::*;
200 /// let value = f16::from_be_bytes([0x4A, 0x40]);
201 /// assert_eq!(value, f16::from_f32(12.5));
202 /// ```
203 #[inline]
204 #[must_use]
205 pub const fn from_be_bytesrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_be_bytes().(bytes: [u8; 2]) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
206 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(u16::from_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]from_be_bytes().(bytes))
207 }
208
209 /// Creates a floating point value from its representation as a byte array in native endian.
210 ///
211 /// As the target platform's native endianness is used, portable code likely wants to use
212 /// [`from_be_bytes`][Self::from_be_bytes] or [`from_le_bytes`][Self::from_le_bytes], as
213 /// appropriate instead.
214 ///
215 /// # Examples
216 ///
217 /// ```rust
218 /// # use half::prelude::*;
219 /// let value = f16::from_ne_bytes(if cfg!(target_endian = "big") {
220 /// [0x4A, 0x40]
221 /// } else {
222 /// [0x40, 0x4A]
223 /// });
224 /// assert_eq!(value, f16::from_f32(12.5));
225 /// ```
226 #[inline]
227 #[must_use]
228 pub const fn from_ne_bytesrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_ne_bytes().(bytes: [u8; 2]) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
229 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(u16::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]from_ne_bytes().(bytes))
230 }
231
232 /// Converts a [`struct@f16`] value into a `f32` value.
233 ///
234 /// This conversion is lossless as all 16-bit floating point values can be represented exactly
235 /// in 32-bit floating point.
236 #[inline]
237 #[must_use]
238 pub fn to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().(self) -> f32 {
239 archrust-analyzer cargo half 2.7.1 binary16/arch/::f16_to_f32rust-analyzer cargo half 2.7.1 binary16/arch/f16_to_f32().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
240 }
241
242 /// Converts a [`struct@f16`] value into a `f32` value.
243 ///
244 /// This function is identical to [`to_f32`][Self::to_f32] except it never uses hardware
245 /// intrinsics, which allows it to be `const`. [`to_f32`][Self::to_f32] should be preferred
246 /// in any non-`const` context.
247 ///
248 /// This conversion is lossless as all 16-bit floating point values can be represented exactly
249 /// in 32-bit floating point.
250 #[inline]
251 #[must_use]
252 pub const fn to_f32_construst-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32_const().(self) -> f32 {
253 archrust-analyzer cargo half 2.7.1 binary16/arch/::f16_to_f32_fallbackrust-analyzer cargo half 2.7.1 binary16/arch/f16_to_f32_fallback().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
254 }
255
256 /// Converts a [`struct@f16`] value into a `f64` value.
257 ///
258 /// This conversion is lossless as all 16-bit floating point values can be represented exactly
259 /// in 64-bit floating point.
260 #[inline]
261 #[must_use]
262 pub fn to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().(self) -> f64 {
263 archrust-analyzer cargo half 2.7.1 binary16/arch/::f16_to_f64rust-analyzer cargo half 2.7.1 binary16/arch/f16_to_f64().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
264 }
265
266 /// Converts a [`struct@f16`] value into a `f64` value.
267 ///
268 /// This function is identical to [`to_f64`][Self::to_f64] except it never uses hardware
269 /// intrinsics, which allows it to be `const`. [`to_f64`][Self::to_f64] should be preferred
270 /// in any non-`const` context.
271 ///
272 /// This conversion is lossless as all 16-bit floating point values can be represented exactly
273 /// in 64-bit floating point.
274 #[inline]
275 #[must_use]
276 pub const fn to_f64_construst-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64_const().(self) -> f64 {
277 archrust-analyzer cargo half 2.7.1 binary16/arch/::f16_to_f64_fallbackrust-analyzer cargo half 2.7.1 binary16/arch/f16_to_f64_fallback().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
278 }
279
280 /// Returns `true` if this value is `NaN` and `false` otherwise.
281 ///
282 /// # Examples
283 ///
284 /// ```rust
285 /// # use half::prelude::*;
286 ///
287 /// let nan = f16::NAN;
288 /// let f = f16::from_f32(7.0_f32);
289 ///
290 /// assert!(nan.is_nan());
291 /// assert!(!f.is_nan());
292 /// ```
293 #[inline]
294 #[must_use]
295 pub const fn is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().(self) -> bool {
296 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().0x7C00u16
297 }
298
299 /// Returns `true` if this value is ±∞ and `false`.
300 /// otherwise.
301 ///
302 /// # Examples
303 ///
304 /// ```rust
305 /// # use half::prelude::*;
306 ///
307 /// let f = f16::from_f32(7.0f32);
308 /// let inf = f16::INFINITY;
309 /// let neg_inf = f16::NEG_INFINITY;
310 /// let nan = f16::NAN;
311 ///
312 /// assert!(!f.is_infinite());
313 /// assert!(!nan.is_infinite());
314 ///
315 /// assert!(inf.is_infinite());
316 /// assert!(neg_inf.is_infinite());
317 /// ```
318 #[inline]
319 #[must_use]
320 pub const fn is_infiniterust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_infinite().(self) -> bool {
321 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0x7C00u16
322 }
323
324 /// Returns `true` if this number is neither infinite nor `NaN`.
325 ///
326 /// # Examples
327 ///
328 /// ```rust
329 /// # use half::prelude::*;
330 ///
331 /// let f = f16::from_f32(7.0f32);
332 /// let inf = f16::INFINITY;
333 /// let neg_inf = f16::NEG_INFINITY;
334 /// let nan = f16::NAN;
335 ///
336 /// assert!(f.is_finite());
337 ///
338 /// assert!(!nan.is_finite());
339 /// assert!(!inf.is_finite());
340 /// assert!(!neg_inf.is_finite());
341 /// ```
342 #[inline]
343 #[must_use]
344 pub const fn is_finiterust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_finite().(self) -> bool {
345 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7C00u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0x7C00u16
346 }
347
348 /// Returns `true` if the number is neither zero, infinite, subnormal, or `NaN`.
349 ///
350 /// # Examples
351 ///
352 /// ```rust
353 /// # use half::prelude::*;
354 ///
355 /// let min = f16::MIN_POSITIVE;
356 /// let max = f16::MAX;
357 /// let lower_than_min = f16::from_f32(1.0e-10_f32);
358 /// let zero = f16::from_f32(0.0_f32);
359 ///
360 /// assert!(min.is_normal());
361 /// assert!(max.is_normal());
362 ///
363 /// assert!(!zero.is_normal());
364 /// assert!(!f16::NAN.is_normal());
365 /// assert!(!f16::INFINITY.is_normal());
366 /// // Values between `0` and `min` are Subnormal.
367 /// assert!(!lower_than_min.is_normal());
368 /// ```
369 #[inline]
370 #[must_use]
371 pub const fn is_normalrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_normal().(self) -> bool {
372 let exp = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7C00u16;
373 exp rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0x7C00u16 && exp rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0
374 }
375
376 /// Returns the floating point category of the number.
377 ///
378 /// If only one property is going to be tested, it is generally faster to use the specific
379 /// predicate instead.
380 ///
381 /// # Examples
382 ///
383 /// ```rust
384 /// use std::num::FpCategory;
385 /// # use half::prelude::*;
386 ///
387 /// let num = f16::from_f32(12.4_f32);
388 /// let inf = f16::INFINITY;
389 ///
390 /// assert_eq!(num.classify(), FpCategory::Normal);
391 /// assert_eq!(inf.classify(), FpCategory::Infinite);
392 /// ```
393 #[must_use]
394 pub const fn classifyrust-analyzer cargo half 2.7.1 binary16/impl#[f16]classify().(self) -> FpCategoryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory# {
395 let exp = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7C00u16;
396 let man = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x03FFu16;
397 match (exp, man) {
398 (0, 0) => FpCategoryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#::Zerorust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#Zero#,
399 (0, _) => FpCategoryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#::Subnormalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#Subnormal#,
400 (0x7C00u16, 0) => FpCategoryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#::Infiniterust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#Infinite#,
401 (0x7C00u16, _) => FpCategoryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#::Nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#Nan#,
402 _ => FpCategoryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#::Normalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/FpCategory#Normal#,
403 }
404 }
405
406 /// Returns a number that represents the sign of `self`.
407 ///
408 /// * `1.0` if the number is positive, `+0.0` or [`INFINITY`][f16::INFINITY]
409 /// * `-1.0` if the number is negative, `-0.0` or [`NEG_INFINITY`][f16::NEG_INFINITY]
410 /// * [`NAN`][f16::NAN] if the number is `NaN`
411 ///
412 /// # Examples
413 ///
414 /// ```rust
415 /// # use half::prelude::*;
416 ///
417 /// let f = f16::from_f32(3.5_f32);
418 ///
419 /// assert_eq!(f.signum(), f16::from_f32(1.0));
420 /// assert_eq!(f16::NEG_INFINITY.signum(), f16::from_f32(-1.0));
421 ///
422 /// assert!(f16::NAN.signum().is_nan());
423 /// ```
424 #[must_use]
425 pub const fn signumrust-analyzer cargo half 2.7.1 binary16/impl#[f16]signum().(self) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
426 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
427 self
428 } else if self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0 {
429 Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16]::NEG_ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_ONE.
430 } else {
431 Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16]::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE.
432 }
433 }
434
435 /// Returns `true` if and only if `self` has a positive sign, including `+0.0`, `NaNs` with a
436 /// positive sign bit and +∞.
437 ///
438 /// # Examples
439 ///
440 /// ```rust
441 /// # use half::prelude::*;
442 ///
443 /// let nan = f16::NAN;
444 /// let f = f16::from_f32(7.0_f32);
445 /// let g = f16::from_f32(-7.0_f32);
446 ///
447 /// assert!(f.is_sign_positive());
448 /// assert!(!g.is_sign_positive());
449 /// // `NaN` can be either positive or negative
450 /// assert!(nan.is_sign_positive() != nan.is_sign_negative());
451 /// ```
452 #[inline]
453 #[must_use]
454 pub const fn is_sign_positiverust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_positive().(self) -> bool {
455 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0
456 }
457
458 /// Returns `true` if and only if `self` has a negative sign, including `-0.0`, `NaNs` with a
459 /// negative sign bit and −∞.
460 ///
461 /// # Examples
462 ///
463 /// ```rust
464 /// # use half::prelude::*;
465 ///
466 /// let nan = f16::NAN;
467 /// let f = f16::from_f32(7.0f32);
468 /// let g = f16::from_f32(-7.0f32);
469 ///
470 /// assert!(!f.is_sign_negative());
471 /// assert!(g.is_sign_negative());
472 /// // `NaN` can be either positive or negative
473 /// assert!(nan.is_sign_positive() != nan.is_sign_negative());
474 /// ```
475 #[inline]
476 #[must_use]
477 pub const fn is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().(self) -> bool {
478 self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0
479 }
480
481 /// Returns a number composed of the magnitude of `self` and the sign of `sign`.
482 ///
483 /// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
484 /// If `self` is NaN, then NaN with the sign of `sign` is returned.
485 ///
486 /// # Examples
487 ///
488 /// ```
489 /// # use half::prelude::*;
490 /// let f = f16::from_f32(3.5);
491 ///
492 /// assert_eq!(f.copysign(f16::from_f32(0.42)), f16::from_f32(3.5));
493 /// assert_eq!(f.copysign(f16::from_f32(-0.42)), f16::from_f32(-3.5));
494 /// assert_eq!((-f).copysign(f16::from_f32(0.42)), f16::from_f32(3.5));
495 /// assert_eq!((-f).copysign(f16::from_f32(-0.42)), f16::from_f32(-3.5));
496 ///
497 /// assert!(f16::NAN.copysign(f16::from_f32(1.0)).is_nan());
498 /// ```
499 #[inline]
500 #[must_use]
501 pub const fn copysignrust-analyzer cargo half 2.7.1 binary16/impl#[f16]copysign().(self, sign: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
502 f16rust-analyzer cargo half 2.7.1 binary16/f16#((sign.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16))
503 }
504
505 /// Returns the maximum of the two numbers.
506 ///
507 /// If one of the arguments is NaN, then the other argument is returned.
508 ///
509 /// # Examples
510 ///
511 /// ```
512 /// # use half::prelude::*;
513 /// let x = f16::from_f32(1.0);
514 /// let y = f16::from_f32(2.0);
515 ///
516 /// assert_eq!(x.max(y), y);
517 /// ```
518 #[inline]
519 #[must_use]
520 pub fn maxrust-analyzer cargo half 2.7.1 binary16/impl#[f16]max().(self, other: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
521 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt().>rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt().self {
522 other
523 } else {
524 self
525 }
526 }
527
528 /// Returns the minimum of the two numbers.
529 ///
530 /// If one of the arguments is NaN, then the other argument is returned.
531 ///
532 /// # Examples
533 ///
534 /// ```
535 /// # use half::prelude::*;
536 /// let x = f16::from_f32(1.0);
537 /// let y = f16::from_f32(2.0);
538 ///
539 /// assert_eq!(x.min(y), x);
540 /// ```
541 #[inline]
542 #[must_use]
543 pub fn minrust-analyzer cargo half 2.7.1 binary16/impl#[f16]min().(self, other: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
544 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt().<rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt().self {
545 other
546 } else {
547 self
548 }
549 }
550
551 /// Restrict a value to a certain interval unless it is NaN.
552 ///
553 /// Returns `max` if `self` is greater than `max`, and `min` if `self` is less than `min`.
554 /// Otherwise this returns `self`.
555 ///
556 /// Note that this function returns NaN if the initial value was NaN as well.
557 ///
558 /// # Panics
559 /// Panics if `min > max`, `min` is NaN, or `max` is NaN.
560 ///
561 /// # Examples
562 ///
563 /// ```
564 /// # use half::prelude::*;
565 /// assert!(f16::from_f32(-3.0).clamp(f16::from_f32(-2.0), f16::from_f32(1.0)) == f16::from_f32(-2.0));
566 /// assert!(f16::from_f32(0.0).clamp(f16::from_f32(-2.0), f16::from_f32(1.0)) == f16::from_f32(0.0));
567 /// assert!(f16::from_f32(2.0).clamp(f16::from_f32(-2.0), f16::from_f32(1.0)) == f16::from_f32(1.0));
568 /// assert!(f16::NAN.clamp(f16::from_f32(-2.0), f16::from_f32(1.0)).is_nan());
569 /// ```
570 #[inline]
571 #[must_use]
572 pub fn clamprust-analyzer cargo half 2.7.1 binary16/impl#[f16]clamp().(self, min: f16rust-analyzer cargo half 2.7.1 binary16/f16#, max: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
573 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(min <= max);
574 let mut x = self;
575 if x rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt().<rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt().min {
576 x = min;
577 }
578 if x rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt().>rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt().max {
579 x = max;
580 }
581 x
582 }
583
584 /// Returns the ordering between `self` and `other`.
585 ///
586 /// Unlike the standard partial comparison between floating point numbers,
587 /// this comparison always produces an ordering in accordance to
588 /// the `totalOrder` predicate as defined in the IEEE 754 (2008 revision)
589 /// floating point standard. The values are ordered in the following sequence:
590 ///
591 /// - negative quiet NaN
592 /// - negative signaling NaN
593 /// - negative infinity
594 /// - negative numbers
595 /// - negative subnormal numbers
596 /// - negative zero
597 /// - positive zero
598 /// - positive subnormal numbers
599 /// - positive numbers
600 /// - positive infinity
601 /// - positive signaling NaN
602 /// - positive quiet NaN.
603 ///
604 /// The ordering established by this function does not always agree with the
605 /// [`PartialOrd`] and [`PartialEq`] implementations of `f16`. For example,
606 /// they consider negative and positive zero equal, while `total_cmp`
607 /// doesn't.
608 ///
609 /// The interpretation of the signaling NaN bit follows the definition in
610 /// the IEEE 754 standard, which may not match the interpretation by some of
611 /// the older, non-conformant (e.g. MIPS) hardware implementations.
612 ///
613 /// # Examples
614 /// ```
615 /// # use half::f16;
616 /// let mut v: Vec<f16> = vec![];
617 /// v.push(f16::ONE);
618 /// v.push(f16::INFINITY);
619 /// v.push(f16::NEG_INFINITY);
620 /// v.push(f16::NAN);
621 /// v.push(f16::MAX_SUBNORMAL);
622 /// v.push(-f16::MAX_SUBNORMAL);
623 /// v.push(f16::ZERO);
624 /// v.push(f16::NEG_ZERO);
625 /// v.push(f16::NEG_ONE);
626 /// v.push(f16::MIN_POSITIVE);
627 ///
628 /// v.sort_by(|a, b| a.total_cmp(&b));
629 ///
630 /// assert!(v
631 /// .into_iter()
632 /// .zip(
633 /// [
634 /// f16::NEG_INFINITY,
635 /// f16::NEG_ONE,
636 /// -f16::MAX_SUBNORMAL,
637 /// f16::NEG_ZERO,
638 /// f16::ZERO,
639 /// f16::MAX_SUBNORMAL,
640 /// f16::MIN_POSITIVE,
641 /// f16::ONE,
642 /// f16::INFINITY,
643 /// f16::NAN
644 /// ]
645 /// .iter()
646 /// )
647 /// .all(|(a, b)| a.to_bits() == b.to_bits()));
648 /// ```
649 // Implementation based on: https://doc.rust-lang.org/std/primitive.f32.html#method.total_cmp
650 #[inline]
651 #[must_use]
652 pub fn total_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16]total_cmp().(&self, other: &Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16]) -> Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering# {
653 let mut left = self.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() as i16;
654 let mut right = other.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() as i16;
655 left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`BitXorAssign<Self>`]bitxor_assign().^=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`BitXorAssign<Self>`]bitxor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`BitXorAssign<Self>`]bitxor_assign().(((left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`Shr<i32>`]shr().15) as u16) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().1) as i16;
656 right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`BitXorAssign<Self>`]bitxor_assign().^=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`BitXorAssign<Self>`]bitxor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`BitXorAssign<Self>`]bitxor_assign().(((right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i16][`Shr<i32>`]shr().15) as u16) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().1) as i16;
657 left.cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i16][Ord]cmp().(&right)
658 }
659
660 /// Alternate serialize adapter for serializing as a float.
661 ///
662 /// By default, [`struct@f16`] serializes as a newtype of [`u16`]. This is an alternate serialize
663 /// implementation that serializes as an [`f32`] value. It is designed for use with
664 /// `serialize_with` serde attributes. Deserialization from `f32` values is already supported by
665 /// the default deserialize implementation.
666 ///
667 /// # Examples
668 ///
669 /// A demonstration on how to use this adapater:
670 ///
671 /// ```
672 /// use serde::{Serialize, Deserialize};
673 /// use half::f16;
674 ///
675 /// #[derive(Serialize, Deserialize)]
676 /// struct MyStruct {
677 /// #[serde(serialize_with = "f16::serialize_as_f32")]
678 /// value: f16 // Will be serialized as f32 instead of u16
679 /// }
680 /// ```
681 #[cfg(feature = "serde")]
682 pub fn serialize_as_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]serialize_as_f32().<S: serderust-analyzer cargo serde 1.0.219 crate/::Serializerrust-analyzer cargo serde 1.0.219 ser/Serializer#>(&self, serializer: S) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<S::Okrust-analyzer cargo serde 1.0.219 ser/Serializer#Ok#, S::Errorrust-analyzer cargo serde 1.0.219 ser/Serializer#Error#> {
683 serializer.serialize_f32rust-analyzer cargo serde 1.0.219 ser/Serializer#serialize_f32().(self.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().())
684 }
685
686 /// Alternate serialize adapter for serializing as a string.
687 ///
688 /// By default, [`struct@f16`] serializes as a newtype of [`u16`]. This is an alternate serialize
689 /// implementation that serializes as a string value. It is designed for use with
690 /// `serialize_with` serde attributes. Deserialization from string values is already supported
691 /// by the default deserialize implementation.
692 ///
693 /// # Examples
694 ///
695 /// A demonstration on how to use this adapater:
696 ///
697 /// ```
698 /// use serde::{Serialize, Deserialize};
699 /// use half::f16;
700 ///
701 /// #[derive(Serialize, Deserialize)]
702 /// struct MyStruct {
703 /// #[serde(serialize_with = "f16::serialize_as_string")]
704 /// value: f16 // Will be serialized as a string instead of u16
705 /// }
706 /// ```
707 #[cfg(all(feature = "serde", feature = "alloc"))]
708 pub fn serialize_as_stringrust-analyzer cargo half 2.7.1 binary16/impl#[f16]serialize_as_string().<S: serderust-analyzer cargo serde 1.0.219 crate/::Serializerrust-analyzer cargo serde 1.0.219 ser/Serializer#>(
709 &self,
710 serializer: S,
711 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<S::Okrust-analyzer cargo serde 1.0.219 ser/Serializer#Ok#, S::Errorrust-analyzer cargo serde 1.0.219 ser/Serializer#Error#> {
712 serializer.serialize_strrust-analyzer cargo serde 1.0.219 ser/Serializer#serialize_str().(&self.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())
713 }
714
715 /// Approximate number of [`struct@f16`] significant digits in base 10
716 pub const DIGITSrust-analyzer cargo half 2.7.1 binary16/impl#[f16]DIGITS.: u32 = 3;
717 /// [`struct@f16`]
718 /// [machine epsilon](https://en.wikipedia.org/wiki/Machine_epsilon) value
719 ///
720 /// This is the difference between 1.0 and the next largest representable number.
721 pub const EPSILONrust-analyzer cargo half 2.7.1 binary16/impl#[f16]EPSILON.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x1400u16);
722 /// [`struct@f16`] positive Infinity (+∞)
723 pub const INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]INFINITY.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x7C00u16);
724 /// Number of [`struct@f16`] significant digits in base 2
725 pub const MANTISSA_DIGITSrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MANTISSA_DIGITS.: u32 = 11;
726 /// Largest finite [`struct@f16`] value
727 pub const MAXrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x7BFF);
728 /// Maximum possible [`struct@f16`] power of 10 exponent
729 pub const MAX_10_EXPrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX_10_EXP.: i32 = 4;
730 /// Maximum possible [`struct@f16`] power of 2 exponent
731 pub const MAX_EXPrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX_EXP.: i32 = 16;
732 /// Smallest finite [`struct@f16`] value
733 pub const MINrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0xFBFF);
734 /// Minimum possible normal [`struct@f16`] power of 10 exponent
735 pub const MIN_10_EXPrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_10_EXP.: i32 = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().4;
736 /// One greater than the minimum possible normal [`struct@f16`] power of 2 exponent
737 pub const MIN_EXPrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_EXP.: i32 = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().13;
738 /// Smallest positive normal [`struct@f16`] value
739 pub const MIN_POSITIVErust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_POSITIVE.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x0400u16);
740 /// [`struct@f16`] Not a Number (NaN)
741 pub const NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x7E00u16);
742 /// [`struct@f16`] negative infinity (-∞)
743 pub const NEG_INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_INFINITY.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0xFC00u16);
744 /// The radix or base of the internal representation of [`struct@f16`]
745 pub const RADIXrust-analyzer cargo half 2.7.1 binary16/impl#[f16]RADIX.: u32 = 2;
746
747 /// Minimum positive subnormal [`struct@f16`] value
748 pub const MIN_POSITIVE_SUBNORMALrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_POSITIVE_SUBNORMAL.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x0001u16);
749 /// Maximum subnormal [`struct@f16`] value
750 pub const MAX_SUBNORMALrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX_SUBNORMAL.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x03FFu16);
751
752 /// [`struct@f16`] 1
753 pub const ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3C00u16);
754 /// [`struct@f16`] 0
755 pub const ZEROrust-analyzer cargo half 2.7.1 binary16/impl#[f16]ZERO.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x0000u16);
756 /// [`struct@f16`] -0
757 pub const NEG_ZEROrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_ZERO.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x8000u16);
758 /// [`struct@f16`] -1
759 pub const NEG_ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_ONE.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0xBC00u16);
760
761 /// [`struct@f16`] Euler's number (ℯ)
762 pub const Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]E.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x4170u16);
763 /// [`struct@f16`] Archimedes' constant (π)
764 pub const PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]PI.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x4248u16);
765 /// [`struct@f16`] 1/π
766 pub const FRAC_1_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_1_PI.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3518u16);
767 /// [`struct@f16`] 1/√2
768 pub const FRAC_1_SQRT_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_1_SQRT_2.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x39A8u16);
769 /// [`struct@f16`] 2/π
770 pub const FRAC_2_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_2_PI.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3918u16);
771 /// [`struct@f16`] 2/√π
772 pub const FRAC_2_SQRT_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_2_SQRT_PI.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3C83u16);
773 /// [`struct@f16`] π/2
774 pub const FRAC_PI_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_2.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3E48u16);
775 /// [`struct@f16`] π/3
776 pub const FRAC_PI_3rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_3.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3C30u16);
777 /// [`struct@f16`] π/4
778 pub const FRAC_PI_4rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_4.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3A48u16);
779 /// [`struct@f16`] π/6
780 pub const FRAC_PI_6rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_6.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3830u16);
781 /// [`struct@f16`] π/8
782 pub const FRAC_PI_8rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_8.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3648u16);
783 /// [`struct@f16`] 𝗅𝗇 10
784 pub const LN_10rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LN_10.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x409Bu16);
785 /// [`struct@f16`] 𝗅𝗇 2
786 pub const LN_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LN_2.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x398Cu16);
787 /// [`struct@f16`] 𝗅𝗈𝗀₁₀ℯ
788 pub const LOG10_Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG10_E.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x36F3u16);
789 /// [`struct@f16`] 𝗅𝗈𝗀₁₀2
790 pub const LOG10_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG10_2.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x34D1u16);
791 /// [`struct@f16`] 𝗅𝗈𝗀₂ℯ
792 pub const LOG2_Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG2_E.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3DC5u16);
793 /// [`struct@f16`] 𝗅𝗈𝗀₂10
794 pub const LOG2_10rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG2_10.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x42A5u16);
795 /// [`struct@f16`] √2
796 pub const SQRT_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]SQRT_2.: f16rust-analyzer cargo half 2.7.1 binary16/f16# = f16rust-analyzer cargo half 2.7.1 binary16/f16#(0x3DA8u16);
797 }
798
799 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f32 {
800 #[inline]
801 fn fromrust-analyzer cargo half 2.7.1 binary16/impl#[f32][`From<f16>`]from().(x: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> f32 {
802 x.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().()
803 }
804 }
805
806 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f64 {
807 #[inline]
808 fn fromrust-analyzer cargo half 2.7.1 binary16/impl#[f64][`From<f16>`]from().(x: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> f64 {
809 x.to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().()
810 }
811 }
812
813 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<i8> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
814 #[inline]
815 fn fromrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`From<i8>`]from().(x: i8) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
816 // Convert to f32, then to f16
817 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(f32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f32][`From<i8>`]from().(x))
818 }
819 }
820
821 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<u8> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
822 #[inline]
823 fn fromrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`From<u8>`]from().(x: u8) -> f16rust-analyzer cargo half 2.7.1 binary16/f16# {
824 // Convert to f32, then to f16
825 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(f32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f32][`From<u8>`]from().(x))
826 }
827 }
828
829 impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
830 fn eqrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialEq<Self>`]eq().(&self, other: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> bool {
831 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
832 false
833 } else {
834 (self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) || ((self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0)
835 }
836 }
837 }
838
839 impl PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
840 fn partial_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]partial_cmp().(&self, other: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> {
841 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
842 Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#
843 } else {
844 let neg = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
845 let other_neg = other.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
846 match (neg, other_neg) {
847 (false, false) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0..cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][Ord]cmp().(&other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)),
848 (false, true) => {
849 if (self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0 {
850 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal#)
851 } else {
852 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Greaterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Greater#)
853 }
854 }
855 (true, false) => {
856 if (self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0 {
857 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal#)
858 } else {
859 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Lessrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Less#)
860 }
861 }
862 (true, true) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(other.0rust-analyzer cargo half 2.7.1 binary16/f16#0..cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][Ord]cmp().(&self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)),
863 }
864 }
865 }
866
867 fn ltrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt().(&self, other: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> bool {
868 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
869 false
870 } else {
871 let neg = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
872 let other_neg = other.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
873 match (neg, other_neg) {
874 (false, false) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
875 (false, true) => false,
876 (true, false) => (self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0,
877 (true, true) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
878 }
879 }
880 }
881
882 fn lerust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]le().(&self, other: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> bool {
883 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
884 false
885 } else {
886 let neg = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
887 let other_neg = other.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
888 match (neg, other_neg) {
889 (false, false) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]le().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
890 (false, true) => (self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0,
891 (true, false) => true,
892 (true, true) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
893 }
894 }
895 }
896
897 fn gtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt().(&self, other: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> bool {
898 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
899 false
900 } else {
901 let neg = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
902 let other_neg = other.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
903 match (neg, other_neg) {
904 (false, false) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]gt().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
905 (false, true) => (self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0,
906 (true, false) => false,
907 (true, true) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
908 }
909 }
910 }
911
912 fn gerust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]ge().(&self, other: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> bool {
913 if self.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() || other.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
914 false
915 } else {
916 let neg = self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
917 let other_neg = other.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x8000u16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0;
918 match (neg, other_neg) {
919 (false, false) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
920 (false, true) => true,
921 (true, false) => (self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().0x7FFFu16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0,
922 (true, true) => self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]le().other.0rust-analyzer cargo half 2.7.1 binary16/f16#0.,
923 }
924 }
925 }
926 }
927
928 #[cfg(not(target_arch = "spirv"))]
929 impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
930 type Errrust-analyzer cargo half 2.7.1 binary16/impl#[f16][FromStr]Err# = ParseFloatErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/dec2flt/ParseFloatError#;
931 fn from_strrust-analyzer cargo half 2.7.1 binary16/impl#[f16][FromStr]from_str().(src: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<f16rust-analyzer cargo half 2.7.1 binary16/f16#, ParseFloatErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/dec2flt/ParseFloatError#> {
932 f32::from_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/dec2flt/impl#[f32][FromStr]from_str().(src).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().)
933 }
934 }
935
936 #[cfg(not(target_arch = "spirv"))]
937 impl Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
938 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Debug]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
939 Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/float/impl#[f32][Debug]fmt().(&self.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().(), f)
940 }
941 }
942
943 #[cfg(not(target_arch = "spirv"))]
944 impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
945 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Display]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
946 Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/float/impl#[f32][Display]fmt().(&self.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().(), f)
947 }
948 }
949
950 #[cfg(not(target_arch = "spirv"))]
951 impl LowerExprust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/LowerExp# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
952 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][LowerExp]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
953 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{:e}", self.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().())
954 }
955 }
956
957 #[cfg(not(target_arch = "spirv"))]
958 impl UpperExprust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/UpperExp# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
959 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][UpperExp]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
960 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{:E}", self.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().())
961 }
962 }
963
964 #[cfg(not(target_arch = "spirv"))]
965 impl Binaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Binary# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
966 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Binary]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
967 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{:b}", self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
968 }
969 }
970
971 #[cfg(not(target_arch = "spirv"))]
972 impl Octalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Octal# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
973 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Octal]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
974 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{:o}", self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
975 }
976 }
977
978 #[cfg(not(target_arch = "spirv"))]
979 impl LowerHexrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/LowerHex# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
980 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][LowerHex]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
981 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{:x}", self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
982 }
983 }
984
985 #[cfg(not(target_arch = "spirv"))]
986 impl UpperHexrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/UpperHex# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
987 fn fmtrust-analyzer cargo half 2.7.1 binary16/impl#[f16][UpperHex]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
988 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{:X}", self.0rust-analyzer cargo half 2.7.1 binary16/f16#0.)
989 }
990 }
991
992 impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
993 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Neg]Output# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Neg];
994
995 #[inline]
996 fn negrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Neg]neg().(self) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Neg]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#Output# {
997 Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Neg](self.0rust-analyzer cargo half 2.7.1 binary16/f16#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitXor<Self>`]bitxor().^rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitXor<Self>`]bitxor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitXor<Self>`]bitxor().0x8000)
998 }
999 }
1000
1001 impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1002 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][Neg]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#Output#;
1003
1004 #[inline]
1005 fn negrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][Neg]neg().(self) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][Neg]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#Output# {
1006 Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#::negrust-analyzer cargo half 2.7.1 binary16/impl#[f16][Neg]neg().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self)
1007 }
1008 }
1009
1010 impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1011 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]Output# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`];
1012
1013 #[inline]
1014 fn addrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]add().(self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# {
1015 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::add_f16rust-analyzer cargo half 2.7.1 binary16/arch/add_f16().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0., rhs.0rust-analyzer cargo half 2.7.1 binary16/f16#0.))
1016 }
1017 }
1018
1019 impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1020 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<&f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output#;
1021
1022 #[inline]
1023 fn addrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<&f16>`]add().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<&f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# {
1024 self.addrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]add().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1025 }
1026 }
1027
1028 impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1029 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Add<Self>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output#;
1030
1031 #[inline]
1032 fn addrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Add<Self>`]add().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Add<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# {
1033 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).addrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]add().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1034 }
1035 }
1036
1037 impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1038 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Add<f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output#;
1039
1040 #[inline]
1041 fn addrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Add<f16>`]add().(self, rhs: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Add<f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# {
1042 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).addrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]add().(rhs)
1043 }
1044 }
1045
1046 impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1047 #[inline]
1048 fn add_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`AddAssign<Self>`]add_assign().(&mut self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`AddAssign<Self>`]) {
1049 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).addrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]add().(rhs);
1050 }
1051 }
1052
1053 impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1054 #[inline]
1055 fn add_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`AddAssign<&f16>`]add_assign().(&mut self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) {
1056 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).addrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<&f16>`]add().(rhs);
1057 }
1058 }
1059
1060 impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1061 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]Output# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`];
1062
1063 #[inline]
1064 fn subrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]sub().(self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output# {
1065 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::subtract_f16rust-analyzer cargo half 2.7.1 binary16/arch/subtract_f16().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0., rhs.0rust-analyzer cargo half 2.7.1 binary16/f16#0.))
1066 }
1067 }
1068
1069 impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1070 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<&f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output#;
1071
1072 #[inline]
1073 fn subrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<&f16>`]sub().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<&f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output# {
1074 self.subrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]sub().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1075 }
1076 }
1077
1078 impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1079 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Sub<Self>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output#;
1080
1081 #[inline]
1082 fn subrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Sub<Self>`]sub().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Sub<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output# {
1083 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).subrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]sub().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1084 }
1085 }
1086
1087 impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1088 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Sub<f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output#;
1089
1090 #[inline]
1091 fn subrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Sub<f16>`]sub().(self, rhs: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Sub<f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output# {
1092 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).subrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]sub().(rhs)
1093 }
1094 }
1095
1096 impl SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1097 #[inline]
1098 fn sub_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`SubAssign<Self>`]sub_assign().(&mut self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`SubAssign<Self>`]) {
1099 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).subrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]sub().(rhs);
1100 }
1101 }
1102
1103 impl SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1104 #[inline]
1105 fn sub_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`SubAssign<&f16>`]sub_assign().(&mut self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) {
1106 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).subrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<&f16>`]sub().(rhs);
1107 }
1108 }
1109
1110 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1111 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]Output# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`];
1112
1113 #[inline]
1114 fn mulrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]mul().(self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1115 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::multiply_f16rust-analyzer cargo half 2.7.1 binary16/arch/multiply_f16().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0., rhs.0rust-analyzer cargo half 2.7.1 binary16/f16#0.))
1116 }
1117 }
1118
1119 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1120 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<&f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output#;
1121
1122 #[inline]
1123 fn mulrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<&f16>`]mul().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<&f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1124 self.mulrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]mul().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1125 }
1126 }
1127
1128 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1129 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Mul<Self>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output#;
1130
1131 #[inline]
1132 fn mulrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Mul<Self>`]mul().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Mul<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1133 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).mulrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]mul().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1134 }
1135 }
1136
1137 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1138 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Mul<f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output#;
1139
1140 #[inline]
1141 fn mulrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Mul<f16>`]mul().(self, rhs: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Mul<f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1142 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).mulrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]mul().(rhs)
1143 }
1144 }
1145
1146 impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1147 #[inline]
1148 fn mul_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`MulAssign<Self>`]mul_assign().(&mut self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`MulAssign<Self>`]) {
1149 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).mulrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]mul().(rhs);
1150 }
1151 }
1152
1153 impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1154 #[inline]
1155 fn mul_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`MulAssign<&f16>`]mul_assign().(&mut self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) {
1156 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).mulrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<&f16>`]mul().(rhs);
1157 }
1158 }
1159
1160 impl Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1161 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]Output# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`];
1162
1163 #[inline]
1164 fn divrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]div().(self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#Output# {
1165 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::divide_f16rust-analyzer cargo half 2.7.1 binary16/arch/divide_f16().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0., rhs.0rust-analyzer cargo half 2.7.1 binary16/f16#0.))
1166 }
1167 }
1168
1169 impl Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1170 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<&f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#Output#;
1171
1172 #[inline]
1173 fn divrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<&f16>`]div().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<&f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#Output# {
1174 self.divrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]div().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1175 }
1176 }
1177
1178 impl Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1179 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Div<Self>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#Output#;
1180
1181 #[inline]
1182 fn divrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Div<Self>`]div().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Div<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#Output# {
1183 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).divrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]div().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1184 }
1185 }
1186
1187 impl Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1188 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Div<f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#Output#;
1189
1190 #[inline]
1191 fn divrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Div<f16>`]div().(self, rhs: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Div<f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#Output# {
1192 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).divrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]div().(rhs)
1193 }
1194 }
1195
1196 impl DivAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1197 #[inline]
1198 fn div_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`DivAssign<Self>`]div_assign().(&mut self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`DivAssign<Self>`]) {
1199 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).divrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]div().(rhs);
1200 }
1201 }
1202
1203 impl DivAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1204 #[inline]
1205 fn div_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`DivAssign<&f16>`]div_assign().(&mut self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) {
1206 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).divrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<&f16>`]div().(rhs);
1207 }
1208 }
1209
1210 impl Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1211 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]Output# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`];
1212
1213 #[inline]
1214 fn remrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]rem().(self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#Output# {
1215 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::remainder_f16rust-analyzer cargo half 2.7.1 binary16/arch/remainder_f16().(self.0rust-analyzer cargo half 2.7.1 binary16/f16#0., rhs.0rust-analyzer cargo half 2.7.1 binary16/f16#0.))
1216 }
1217 }
1218
1219 impl Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1220 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<&f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#Output#;
1221
1222 #[inline]
1223 fn remrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<&f16>`]rem().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<&f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#Output# {
1224 self.remrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]rem().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1225 }
1226 }
1227
1228 impl Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1229 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Rem<Self>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#Output#;
1230
1231 #[inline]
1232 fn remrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Rem<Self>`]rem().(self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Rem<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#Output# {
1233 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).remrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]rem().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().rhs)
1234 }
1235 }
1236
1237 impl Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#<f16rust-analyzer cargo half 2.7.1 binary16/f16#> for &f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1238 type Outputrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Rem<f16>`]Output# = <f16rust-analyzer cargo half 2.7.1 binary16/f16# as Remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#Output#;
1239
1240 #[inline]
1241 fn remrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Rem<f16>`]rem().(self, rhs: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[`&f16`][`Rem<f16>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#Output# {
1242 (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self).remrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]rem().(rhs)
1243 }
1244 }
1245
1246 impl RemAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1247 #[inline]
1248 fn rem_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`RemAssign<Self>`]rem_assign().(&mut self, rhs: Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`RemAssign<Self>`]) {
1249 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).remrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]rem().(rhs);
1250 }
1251 }
1252
1253 impl RemAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#<&f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1254 #[inline]
1255 fn rem_assignrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`RemAssign<&f16>`]rem_assign().(&mut self, rhs: &f16rust-analyzer cargo half 2.7.1 binary16/f16#) {
1256 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self).remrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<&f16>`]rem().(rhs);
1257 }
1258 }
1259
1260 impl Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1261 #[inline]
1262 fn productrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Product<Self>`]product().<I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Product<Self>`]>>(iter: I) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Product<Self>`] {
1263 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::product_f16rust-analyzer cargo half 2.7.1 binary16/arch/product_f16().(iter.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|f| f.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().())))
1264 }
1265 }
1266
1267 impl<'a> Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product#<&'a f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1268 #[inline]
1269 fn productrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Product<&'a f16>`]product().<I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a f16rust-analyzer cargo half 2.7.1 binary16/f16#>>(iter: I) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Product<&'a f16>`] {
1270 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::product_f16rust-analyzer cargo half 2.7.1 binary16/arch/product_f16().(iter.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|f| f.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().())))
1271 }
1272 }
1273
1274 impl Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1275 #[inline]
1276 fn sumrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sum<Self>`]sum().<I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sum<Self>`]>>(iter: I) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sum<Self>`] {
1277 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::sum_f16rust-analyzer cargo half 2.7.1 binary16/arch/sum_f16().(iter.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|f| f.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().())))
1278 }
1279 }
1280
1281 impl<'a> Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#<&'a f16rust-analyzer cargo half 2.7.1 binary16/f16#> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1282 #[inline]
1283 fn sumrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sum<&'a f16>`]sum().<I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a f16rust-analyzer cargo half 2.7.1 binary16/f16#>>(iter: I) -> Selfrust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sum<&'a f16>`] {
1284 f16rust-analyzer cargo half 2.7.1 binary16/f16#(archrust-analyzer cargo half 2.7.1 binary16/arch/::sum_f16rust-analyzer cargo half 2.7.1 binary16/arch/sum_f16().(iter.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|f| f.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().())))
1285 }
1286 }
1287
1288 #[cfg(feature = "serde")]
1289 struct Visitorrust-analyzer cargo half 2.7.1 binary16/Visitor#;
1290
1291 #[cfg(feature = "serde")]
1292 impl<'de> Deserializerust-analyzer cargo serde 1.0.219 de/Deserialize#<'de> for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1293 fn deserializerust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Deserialize<'de>`]deserialize().<D>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<f16rust-analyzer cargo half 2.7.1 binary16/f16#, D::Errorrust-analyzer cargo serde 1.0.219 de/Deserializer#Error#>
1294 where
1295 D: serderust-analyzer cargo serde 1.0.219 crate/::derust-analyzer cargo serde 1.0.219 de/::Deserializerrust-analyzer cargo serde 1.0.219 de/Deserializer#<'de>,
1296 {
1297 deserializer.deserialize_newtype_structrust-analyzer cargo serde 1.0.219 de/Deserializer#deserialize_newtype_struct().("f16", Visitorrust-analyzer cargo half 2.7.1 binary16/Visitor#)
1298 }
1299 }
1300
1301 #[cfg(feature = "serde")]
1302 impl<'de> serderust-analyzer cargo serde 1.0.219 crate/::derust-analyzer cargo serde 1.0.219 de/::Visitorrust-analyzer cargo serde 1.0.219 de/Visitor#<'de> for Visitorrust-analyzer cargo half 2.7.1 binary16/Visitor# {
1303 type Valuerust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]Value# = f16rust-analyzer cargo half 2.7.1 binary16/f16#;
1304
1305 fn expectingrust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]expecting().(&self, formatter: &mut corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
1306 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(formatter, "tuple struct f16")
1307 }
1308
1309 fn visit_newtype_structrust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]visit_newtype_struct().<D>(self, deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde 1.0.219 de/Visitor#Value#, D::Errorrust-analyzer cargo serde 1.0.219 de/Deserializer#Error#>
1310 where
1311 D: serderust-analyzer cargo serde 1.0.219 crate/::Deserializerrust-analyzer cargo serde 1.0.219 de/Deserializer#<'de>,
1312 {
1313 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(f16rust-analyzer cargo half 2.7.1 binary16/f16#(<u16 as Deserializerust-analyzer cargo serde 1.0.219 de/Deserialize#>::deserializerust-analyzer cargo serde 1.0.219 de/impls/impl#[u16][`Deserialize<'de>`]deserialize().(deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().))
1314 }
1315
1316 fn visit_strrust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]visit_str().<E>(self, v: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde 1.0.219 de/Visitor#Value#, E>
1317 where
1318 E: serderust-analyzer cargo serde 1.0.219 crate/::derust-analyzer cargo serde 1.0.219 de/::Errorrust-analyzer cargo serde 1.0.219 de/Error#,
1319 {
1320 v.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().().map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| {
1321 serderust-analyzer cargo serde 1.0.219 crate/::derust-analyzer cargo serde 1.0.219 de/::Errorrust-analyzer cargo serde 1.0.219 de/Error#::invalid_valuerust-analyzer cargo serde 1.0.219 de/Error#invalid_value().(serderust-analyzer cargo serde 1.0.219 crate/::derust-analyzer cargo serde 1.0.219 de/::Unexpectedrust-analyzer cargo serde 1.0.219 de/Unexpected#::Strrust-analyzer cargo serde 1.0.219 de/Unexpected#Str#(v), &"a float string")
1322 })
1323 }
1324
1325 fn visit_f32rust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]visit_f32().<E>(self, v: f32) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde 1.0.219 de/Visitor#Value#, E>
1326 where
1327 E: serderust-analyzer cargo serde 1.0.219 crate/::derust-analyzer cargo serde 1.0.219 de/::Errorrust-analyzer cargo serde 1.0.219 de/Error#,
1328 {
1329 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(v))
1330 }
1331
1332 fn visit_f64rust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]visit_f64().<E>(self, v: f64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo half 2.7.1 binary16/impl#[Visitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde 1.0.219 de/Visitor#Value#, E>
1333 where
1334 E: serderust-analyzer cargo serde 1.0.219 crate/::derust-analyzer cargo serde 1.0.219 de/::Errorrust-analyzer cargo serde 1.0.219 de/Error#,
1335 {
1336 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(v))
1337 }
1338 }
1339
1340 #[allow(
1341 clippy::cognitive_complexity,
1342 clippy::float_cmp,
1343 clippy::neg_cmp_op_on_partial_ord
1344 )]
1345 #[cfg(test)]
1346 mod testrust-analyzer cargo half 2.7.1 binary16/test/ {
1347 use superrust-analyzer cargo half 2.7.1 binary16/::*;
1348 #[allow(unused_imports)]
1349 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#;
1350 #[cfg(feature = "num-traits")]
1351 use num_traitsrust-analyzer cargo num-traits 0.2.16 crate/::{AsPrimitiverust-analyzer cargo num-traits 0.2.16 cast/AsPrimitive#, FromBytesrust-analyzer cargo num-traits 0.2.16 ops/bytes/FromBytes#, FromPrimitiverust-analyzer cargo num-traits 0.2.16 cast/FromPrimitive#, ToBytesrust-analyzer cargo num-traits 0.2.16 ops/bytes/ToBytes#, ToPrimitiverust-analyzer cargo num-traits 0.2.16 cast/ToPrimitive#};
1352 use quickcheck_macrosrust-analyzer cargo quickcheck_macros 1.0.0 crate/::quickcheckrust-analyzer cargo quickcheck_macros 1.0.0 quickcheck:;
1353
1354 #[cfg(feature = "num-traits")]
1355 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1356 fn as_primitiverust-analyzer cargo half 2.7.1 binary16/test/as_primitive().() {
1357 let two = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.0);
1358 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<i32 as AsPrimitiverust-analyzer cargo num-traits 0.2.16 cast/AsPrimitive#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::as_rust-analyzer cargo half 2.7.1 num_traits/impl#[i32][`AsPrimitive<f16>`]as_().(2), two);
1359 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as AsPrimitiverust-analyzer cargo num-traits 0.2.16 cast/AsPrimitive#<i32>>::as_rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][`AsPrimitive<i32>`]as_().(two), 2);
1360
1361 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f32 as AsPrimitiverust-analyzer cargo num-traits 0.2.16 cast/AsPrimitive#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::as_rust-analyzer cargo half 2.7.1 num_traits/impl#[f32][`AsPrimitive<f16>`]as_().(2.0), two);
1362 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as AsPrimitiverust-analyzer cargo num-traits 0.2.16 cast/AsPrimitive#<f32>>::as_rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][`AsPrimitive<f32>`]as_().(two), 2.0);
1363
1364 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f64 as AsPrimitiverust-analyzer cargo num-traits 0.2.16 cast/AsPrimitive#<f16rust-analyzer cargo half 2.7.1 binary16/f16#>>::as_rust-analyzer cargo half 2.7.1 num_traits/impl#[f64][`AsPrimitive<f16>`]as_().(2.0), two);
1365 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as AsPrimitiverust-analyzer cargo num-traits 0.2.16 cast/AsPrimitive#<f64>>::as_rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][`AsPrimitive<f64>`]as_().(two), 2.0);
1366 }
1367
1368 #[cfg(feature = "num-traits")]
1369 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1370 fn to_primitiverust-analyzer cargo half 2.7.1 binary16/test/to_primitive().() {
1371 let two = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.0);
1372 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(ToPrimitiverust-analyzer cargo num-traits 0.2.16 cast/ToPrimitive#::to_i32rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][ToPrimitive]to_i32().(&two).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), 2i32);
1373 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(ToPrimitiverust-analyzer cargo num-traits 0.2.16 cast/ToPrimitive#::to_f32rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][ToPrimitive]to_f32().(&two).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), 2.0f32);
1374 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(ToPrimitiverust-analyzer cargo num-traits 0.2.16 cast/ToPrimitive#::to_f64rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][ToPrimitive]to_f64().(&two).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), 2.0f64);
1375 }
1376
1377 #[cfg(feature = "num-traits")]
1378 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1379 fn from_primitiverust-analyzer cargo half 2.7.1 binary16/test/from_primitive().() {
1380 let two = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.0);
1381 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as FromPrimitiverust-analyzer cargo num-traits 0.2.16 cast/FromPrimitive#>::from_i32rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][FromPrimitive]from_i32().(2).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), two);
1382 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as FromPrimitiverust-analyzer cargo num-traits 0.2.16 cast/FromPrimitive#>::from_f32rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][FromPrimitive]from_f32().(2.0).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), two);
1383 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as FromPrimitiverust-analyzer cargo num-traits 0.2.16 cast/FromPrimitive#>::from_f64rust-analyzer cargo half 2.7.1 num_traits/impl#[f16][FromPrimitive]from_f64().(2.0).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), two);
1384 }
1385
1386 #[cfg(feature = "num-traits")]
1387 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1388 fn to_and_from_bytesrust-analyzer cargo half 2.7.1 binary16/test/to_and_from_bytes().() {
1389 let two = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.0);
1390 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as ToBytesrust-analyzer cargo num-traits 0.2.16 ops/bytes/ToBytes#>::to_le_bytesrust-analyzer cargo half 2.7.1 num_traits/impl#[f16][ToBytes]to_le_bytes().(&two), [0, 64]);
1391 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as FromBytesrust-analyzer cargo num-traits 0.2.16 ops/bytes/FromBytes#>::from_le_bytesrust-analyzer cargo half 2.7.1 num_traits/impl#[f16][FromBytes]from_le_bytes().(&[0, 64]), two);
1392 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as ToBytesrust-analyzer cargo num-traits 0.2.16 ops/bytes/ToBytes#>::to_be_bytesrust-analyzer cargo half 2.7.1 num_traits/impl#[f16][ToBytes]to_be_bytes().(&two), [64, 0]);
1393 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(<f16rust-analyzer cargo half 2.7.1 binary16/f16# as FromBytesrust-analyzer cargo num-traits 0.2.16 ops/bytes/FromBytes#>::from_be_bytesrust-analyzer cargo half 2.7.1 num_traits/impl#[f16][FromBytes]from_be_bytes().(&[64, 0]), two);
1394 }
1395
1396 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1397 #[cfg_attr(miri, ignore)]
1398 fn test_f16_constsrust-analyzer cargo half 2.7.1 binary16/test/test_f16_consts().() {
1399 // DIGITS
1400 let digits = ((f16rust-analyzer cargo half 2.7.1 binary16/f16#::MANTISSA_DIGITSrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MANTISSA_DIGITS. as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().1.0) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().2f32.log10rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]log10().()).floorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]floor().() as u32;
1401 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::DIGITSrust-analyzer cargo half 2.7.1 binary16/impl#[f16]DIGITS., digits);
1402 // sanity check to show test is good
1403 let digits32 = ((corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MANTISSA_DIGITSrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MANTISSA_DIGITS. as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().1.0) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().2f32.log10rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]log10().()).floorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]floor().() as u32;
1404 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::DIGITSrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/DIGITS., digits32);
1405
1406 // EPSILON
1407 let one = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(1.0);
1408 let one_plus_epsilon = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(one.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().1);
1409 let epsilon = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(one_plus_epsilon.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().1.0);
1410 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::EPSILONrust-analyzer cargo half 2.7.1 binary16/impl#[f16]EPSILON., epsilon);
1411 // sanity check to show test is good
1412 let one_plus_epsilon32 = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(1.0f32.to_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().1);
1413 let epsilon32 = one_plus_epsilon32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().1f32;
1414 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::EPSILONrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/EPSILON., epsilon32);
1415
1416 // MAX, MIN and MIN_POSITIVE
1417 let max = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(f16rust-analyzer cargo half 2.7.1 binary16/f16#::INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]INFINITY..to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().1);
1418 let min = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NEG_INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_INFINITY..to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Sub<Self>`]sub().1);
1419 let min_pos = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(f16rust-analyzer cargo half 2.7.1 binary16/f16#::MIN_EXPrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_EXP. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().1));
1420 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::MAXrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX., max);
1421 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::MINrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN., min);
1422 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::MIN_POSITIVErust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_POSITIVE., min_pos);
1423 // sanity check to show test is good
1424 let max32 = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/INFINITY..to_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1);
1425 let min32 = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::NEG_INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/NEG_INFINITY..to_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1);
1426 let min_pos32 = 2f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MIN_EXPrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MIN_EXP. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().1);
1427 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MAX., max32);
1428 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MINrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MIN., min32);
1429 #[cfg(target_has_atomic = "64")]
1430 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MIN_POSITIVErust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MIN_POSITIVE., min_pos32);
1431
•1432 // MIN_10_EXP and MAX_10_EXP
1433 let ten_to_min = 10f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(f16rust-analyzer cargo half 2.7.1 binary16/f16#::MIN_10_EXPrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_10_EXP.);
1434 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_min /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 10.0 <rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::MIN_POSITIVErust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_POSITIVE..to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().());
1435 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_min >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]gt(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::MIN_POSITIVErust-analyzer cargo half 2.7.1 binary16/impl#[f16]MIN_POSITIVE..to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().());
1436 let ten_to_max = 10f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(f16rust-analyzer cargo half 2.7.1 binary16/f16#::MAX_10_EXPrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX_10_EXP.);
1437 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_max <rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::MAXrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX..to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().());
1438 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_max *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 10.0 >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]gt(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::MAXrust-analyzer cargo half 2.7.1 binary16/impl#[f16]MAX..to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().());
1439 // sanity check to show test is good
1440 let ten_to_min32 = 10f64.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]powi().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MIN_10_EXPrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MIN_10_EXP.);
1441 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_min32 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Div<Self>`]div(). 10.0 <rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f64][`PartialOrd<Self>`]lt(). f64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f64][`From<f32>`]from().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MIN_POSITIVErust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MIN_POSITIVE.));
1442 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_min32 >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f64][`PartialOrd<Self>`]gt(). f64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f64][`From<f32>`]from().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MIN_POSITIVErust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MIN_POSITIVE.));
1443 let ten_to_max32 = 10f64.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]powi().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MAX_10_EXPrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MAX_10_EXP.);
1444 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_max32 <rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f64][`PartialOrd<Self>`]lt(). f64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f64][`From<f32>`]from().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MAX.));
1445 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(ten_to_max32 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 10.0 >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f64][`PartialOrd<Self>`]gt(). f64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f64][`From<f32>`]from().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/MAX.));
1446 }
1447
1448 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1449 fn test_f16_consts_from_f32rust-analyzer cargo half 2.7.1 binary16/test/test_f16_consts_from_f32().() {
1450 let one = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(1.0);
1451 let zero = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(0.0);
1452 let neg_zero = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().0.0);
1453 let neg_one = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0);
1454 let inf = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/INFINITY.);
1455 let neg_inf = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::NEG_INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/NEG_INFINITY.);
1456 let nan = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/NAN.);
1457
1458 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE., one);
1459 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ZEROrust-analyzer cargo half 2.7.1 binary16/impl#[f16]ZERO., zero);
1460 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(zero.is_sign_positiverust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_positive().());
1461 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NEG_ZEROrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_ZERO., neg_zero);
1462 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().());
1463 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NEG_ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_ONE., neg_one);
1464 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_one.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().());
1465 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]INFINITY., inf);
1466 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NEG_INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_INFINITY., neg_inf);
1467 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1468 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN..is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1469
1470 let e = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::Erust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/E.);
1471 let pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/PI.);
1472 let frac_1_pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_1_PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_1_PI.);
1473 let frac_1_sqrt_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_1_SQRT_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_1_SQRT_2.);
1474 let frac_2_pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_2_PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_2_PI.);
1475 let frac_2_sqrt_pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_2_SQRT_PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_2_SQRT_PI.);
1476 let frac_pi_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_PI_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_PI_2.);
1477 let frac_pi_3 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_PI_3rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_PI_3.);
1478 let frac_pi_4 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_PI_4rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_PI_4.);
1479 let frac_pi_6 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_PI_6rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_PI_6.);
1480 let frac_pi_8 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::FRAC_PI_8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/FRAC_PI_8.);
1481 let ln_10 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::LN_10rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/LN_10.);
1482 let ln_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::LN_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/LN_2.);
1483 let log10_e = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::LOG10_Erust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/LOG10_E.);
1484 // core::f32::consts::LOG10_2 requires rustc 1.43.0
1485 let log10_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2f32.log10rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]log10().());
1486 let log2_e = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::LOG2_Erust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/LOG2_E.);
1487 // core::f32::consts::LOG2_10 requires rustc 1.43.0
1488 let log2_10 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(10f32.log2rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]log2().());
1489 let sqrt_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::SQRT_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/SQRT_2.);
1490
1491 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]E., e);
1492 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]PI., pi);
1493 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_1_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_1_PI., frac_1_pi);
1494 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_1_SQRT_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_1_SQRT_2., frac_1_sqrt_2);
1495 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_2_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_2_PI., frac_2_pi);
1496 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_2_SQRT_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_2_SQRT_PI., frac_2_sqrt_pi);
1497 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_2., frac_pi_2);
1498 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_3rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_3., frac_pi_3);
1499 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_4rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_4., frac_pi_4);
1500 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_6rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_6., frac_pi_6);
1501 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_8rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_8., frac_pi_8);
1502 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LN_10rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LN_10., ln_10);
1503 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LN_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LN_2., ln_2);
1504 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG10_Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG10_E., log10_e);
1505 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG10_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG10_2., log10_2);
1506 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG2_Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG2_E., log2_e);
1507 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG2_10rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG2_10., log2_10);
1508 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::SQRT_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]SQRT_2., sqrt_2);
1509 }
1510
1511 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1512 fn test_f16_consts_from_f64rust-analyzer cargo half 2.7.1 binary16/test/test_f16_consts_from_f64().() {
1513 let one = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(1.0);
1514 let zero = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(0.0);
1515 let neg_zero = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().0.0);
1516 let inf = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/INFINITY.);
1517 let neg_inf = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::NEG_INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/NEG_INFINITY.);
1518 let nan = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/NAN.);
1519
1520 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE., one);
1521 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ZEROrust-analyzer cargo half 2.7.1 binary16/impl#[f16]ZERO., zero);
1522 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(zero.is_sign_positiverust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_positive().());
1523 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NEG_ZEROrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_ZERO., neg_zero);
1524 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().());
1525 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]INFINITY., inf);
1526 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NEG_INFINITYrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NEG_INFINITY., neg_inf);
1527 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1528 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN..is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1529
1530 let e = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::Erust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/E.);
1531 let pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/PI.);
1532 let frac_1_pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_1_PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_1_PI.);
1533 let frac_1_sqrt_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_1_SQRT_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_1_SQRT_2.);
1534 let frac_2_pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_2_PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_2_PI.);
1535 let frac_2_sqrt_pi = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_2_SQRT_PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_2_SQRT_PI.);
1536 let frac_pi_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_PI_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_PI_2.);
1537 let frac_pi_3 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_PI_3rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_PI_3.);
1538 let frac_pi_4 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_PI_4rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_PI_4.);
1539 let frac_pi_6 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_PI_6rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_PI_6.);
1540 let frac_pi_8 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::FRAC_PI_8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/FRAC_PI_8.);
1541 let ln_10 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::LN_10rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/LN_10.);
1542 let ln_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::LN_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/LN_2.);
1543 let log10_e = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::LOG10_Erust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/LOG10_E.);
1544 // core::f64::consts::LOG10_2 requires rustc 1.43.0
1545 let log10_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2f64.log10rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]log10().());
1546 let log2_e = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::LOG2_Erust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/LOG2_E.);
1547 // core::f64::consts::LOG2_10 requires rustc 1.43.0
1548 let log2_10 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(10f64.log2rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]log2().());
1549 let sqrt_2 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/::SQRT_2rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/consts/SQRT_2.);
1550
1551 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]E., e);
1552 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]PI., pi);
1553 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_1_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_1_PI., frac_1_pi);
1554 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_1_SQRT_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_1_SQRT_2., frac_1_sqrt_2);
1555 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_2_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_2_PI., frac_2_pi);
1556 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_2_SQRT_PIrust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_2_SQRT_PI., frac_2_sqrt_pi);
1557 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_2., frac_pi_2);
1558 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_3rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_3., frac_pi_3);
1559 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_4rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_4., frac_pi_4);
1560 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_6rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_6., frac_pi_6);
1561 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::FRAC_PI_8rust-analyzer cargo half 2.7.1 binary16/impl#[f16]FRAC_PI_8., frac_pi_8);
1562 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LN_10rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LN_10., ln_10);
1563 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LN_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LN_2., ln_2);
1564 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG10_Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG10_E., log10_e);
1565 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG10_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG10_2., log10_2);
1566 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG2_Erust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG2_E., log2_e);
1567 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::LOG2_10rust-analyzer cargo half 2.7.1 binary16/impl#[f16]LOG2_10., log2_10);
1568 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::SQRT_2rust-analyzer cargo half 2.7.1 binary16/impl#[f16]SQRT_2., sqrt_2);
1569 }
1570
1571 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1572 fn test_nan_conversion_to_smallerrust-analyzer cargo half 2.7.1 binary16/test/test_nan_conversion_to_smaller().() {
1573 let nan64 = f64::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]from_bits().(0x7FF0_0000_0000_0001u64);
1574 let neg_nan64 = f64::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]from_bits().(0xFFF0_0000_0000_0001u64);
1575 let nan32 = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(0x7F80_0001u32);
1576 let neg_nan32 = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(0xFF80_0001u32);
1577 let nan32_from_64 = nan64 as f32;
1578 let neg_nan32_from_64 = neg_nan64 as f32;
1579 let nan16_from_64 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(nan64);
1580 let neg_nan16_from_64 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(neg_nan64);
1581 let nan16_from_32 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(nan32);
1582 let neg_nan16_from_32 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(neg_nan32);
1583
1584 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan64.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_nan().() && nan64.is_sign_positiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_sign_positive().());
1585 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan64.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_nan().() && neg_nan64.is_sign_negativerust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_sign_negative().());
1586 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan32.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().() && nan32.is_sign_positiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_sign_positive().());
1587 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan32.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().() && neg_nan32.is_sign_negativerust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_sign_negative().());
1588
1589 // f32/f64 NaN conversion sign is non-deterministic: https://github.com/VoidStarKat/half-rs/issues/103
1590 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan32_from_64.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().());
1591 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan32_from_64.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().());
1592 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan16_from_64.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1593 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan16_from_64.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1594 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan16_from_32.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1595 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan16_from_32.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1596 }
1597
1598 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1599 fn test_nan_conversion_to_largerrust-analyzer cargo half 2.7.1 binary16/test/test_nan_conversion_to_larger().() {
1600 let nan16 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x7C01u16);
1601 let neg_nan16 = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0xFC01u16);
1602 let nan32 = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(0x7F80_0001u32);
1603 let neg_nan32 = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(0xFF80_0001u32);
1604 let nan32_from_16 = f32::fromrust-analyzer cargo half 2.7.1 binary16/impl#[f32][`From<f16>`]from().(nan16);
1605 let neg_nan32_from_16 = f32::fromrust-analyzer cargo half 2.7.1 binary16/impl#[f32][`From<f16>`]from().(neg_nan16);
1606 let nan64_from_16 = f64::fromrust-analyzer cargo half 2.7.1 binary16/impl#[f64][`From<f16>`]from().(nan16);
1607 let neg_nan64_from_16 = f64::fromrust-analyzer cargo half 2.7.1 binary16/impl#[f64][`From<f16>`]from().(neg_nan16);
1608 let nan64_from_32 = f64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f64][`From<f32>`]from().(nan32);
1609 let neg_nan64_from_32 = f64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[f64][`From<f32>`]from().(neg_nan32);
1610
1611 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan16.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() && nan16.is_sign_positiverust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_positive().());
1612 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan16.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() && neg_nan16.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().());
1613 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan32.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().() && nan32.is_sign_positiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_sign_positive().());
1614 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan32.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().() && neg_nan32.is_sign_negativerust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_sign_negative().());
1615
1616 // f32/f64 NaN conversion sign is non-deterministic: https://github.com/VoidStarKat/half-rs/issues/103
1617 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan32_from_16.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().());
1618 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan32_from_16.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_nan().());
1619 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan64_from_16.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_nan().());
1620 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan64_from_16.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_nan().());
1621 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(nan64_from_32.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_nan().());
1622 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_nan64_from_32.is_nanrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]is_nan().());
1623 }
1624
1625 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1626 #[cfg_attr(miri, ignore)]
1627 fn test_f16_to_f32rust-analyzer cargo half 2.7.1 binary16/test/test_f16_to_f32().() {
1628 let f = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(7.0);
1629 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().(), 7.0f32);
1630
1631 // 7.1 is NOT exactly representable in 16-bit, it's rounded
1632 let f = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(7.1);
1633 let diff = (f.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().7.1f32).absrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]abs().();
1634 // diff must be <= 4 * EPSILON, as 7 has two more significant bits than 1
1635 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(diff <= 4.0 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::EPSILONrust-analyzer cargo half 2.7.1 binary16/impl#[f16]EPSILON..to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().());
1636
1637 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0001).to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().(), 2.0f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24));
1638 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0005).to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().(), 5.0 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 2.0f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24));
1639
1640 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0001), f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.0f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24)));
1641 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1642 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0005),
1643 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(5.0 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 2.0f32.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24))
1644 );
1645 }
1646
1647 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1648 #[cfg_attr(miri, ignore)]
1649 fn test_f16_to_f64rust-analyzer cargo half 2.7.1 binary16/test/test_f16_to_f64().() {
1650 let f = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(7.0);
1651 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().(), 7.0f64);
1652
1653 // 7.1 is NOT exactly representable in 16-bit, it's rounded
1654 let f = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(7.1);
1655 let diff = (f.to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Sub<Self>`]sub().7.1f64).absrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]abs().();
1656 // diff must be <= 4 * EPSILON, as 7 has two more significant bits than 1
1657 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(diff <= 4.0 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::EPSILONrust-analyzer cargo half 2.7.1 binary16/impl#[f16]EPSILON..to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().());
1658
1659 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0001).to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().(), 2.0f64.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24));
1660 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0005).to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().(), 5.0 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 2.0f64.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24));
1661
1662 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0001), f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2.0f64.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24)));
1663 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1664 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(0x0000_0005),
1665 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(5.0 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 2.0f64.powirust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]powi().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().24))
1666 );
1667 }
1668
1669 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1670 fn test_comparisonsrust-analyzer cargo half 2.7.1 binary16/test/test_comparisons().() {
1671 let zero = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(0.0);
1672 let one = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(1.0);
1673 let neg_zero = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().0.0);
1674 let neg_one = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().1.0);
1675
1676 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(zero.partial_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]partial_cmp().(&neg_zero), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal#));
1677 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(neg_zero.partial_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]partial_cmp().(&zero), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Equalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Equal#));
1678 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(zero == neg_zero);
1679 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero == zero);
1680 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(zero != neg_zero));
1681 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_zero != zero));
1682 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(zero <rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). neg_zero));
1683 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_zero <rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). zero));
1684 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(zero <= neg_zero);
1685 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero <= zero);
1686 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(zero >rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). neg_zero));
1687 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_zero >rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). zero));
1688 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(zero >= neg_zero);
1689 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero >= zero);
1690
1691 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(one.partial_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]partial_cmp().(&neg_zero), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Greaterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Greater#));
1692 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(neg_zero.partial_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]partial_cmp().(&one), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Lessrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Less#));
1693 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(one == neg_zero));
1694 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_zero == one));
1695 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(one != neg_zero);
1696 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero != one);
1697 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(one <rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). neg_zero));
1698 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero <rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). one);
1699 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(one <= neg_zero));
1700 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_zero <= one);
1701 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(one >rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). neg_zero);
1702 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_zero >rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). one));
1703 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(one >= neg_zero);
1704 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_zero >= one));
1705
1706 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(one.partial_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]partial_cmp().(&neg_one), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Greaterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Greater#));
1707 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(neg_one.partial_cmprust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]partial_cmp().(&one), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#::Lessrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#Less#));
1708 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(one == neg_one));
1709 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_one == one));
1710 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(one != neg_one);
1711 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_one != one);
1712 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(one <rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). neg_one));
1713 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_one <rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]lt(). one);
1714 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(one <= neg_one));
1715 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(neg_one <= one);
1716 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(one >rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). neg_one);
1717 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_one >rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`PartialOrd<Self>`]gt(). one));
1718 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(one >= neg_one);
1719 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().(neg_one >= one));
1720 }
1721
1722 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1723 #[allow(clippy::erasing_op, clippy::identity_op)]
1724 #[cfg_attr(miri, ignore)]
1725 fn round_to_even_f32rust-analyzer cargo half 2.7.1 binary16/test/round_to_even_f32().() {
1726 // smallest positive subnormal = 0b0.0000_0000_01 * 2^-14 = 2^-24
1727 let min_sub = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(1);
1728 let min_sub_f = (-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().24f32).exp2rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]exp2().();
1729 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(), min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().());
1730 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f32::fromrust-analyzer cargo half 2.7.1 binary16/impl#[f32][`From<f16>`]from().(min_sub).to_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]to_bits().(), min_sub_f.to_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]to_bits().());
1731
1732 // 0.0000000000_011111 rounded to 0.0000000000 (< tie, no rounding)
1733 // 0.0000000000_100000 rounded to 0.0000000000 (tie and even, remains at even)
1734 // 0.0000000000_100001 rounded to 0.0000000001 (> tie, rounds up)
1735 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1736 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 0.49).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1737 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 0
1738 );
1739 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1740 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 0.50).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1741 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 0
1742 );
1743 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1744 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 0.51).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1745 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 1
1746 );
1747
1748 // 0.0000000001_011111 rounded to 0.0000000001 (< tie, no rounding)
1749 // 0.0000000001_100000 rounded to 0.0000000010 (tie and odd, rounds up to even)
1750 // 0.0000000001_100001 rounded to 0.0000000010 (> tie, rounds up)
1751 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1752 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 1.49).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1753 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 1
1754 );
1755 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1756 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 1.50).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1757 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1758 );
1759 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1760 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 1.51).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1761 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1762 );
1763
1764 // 0.0000000010_011111 rounded to 0.0000000010 (< tie, no rounding)
1765 // 0.0000000010_100000 rounded to 0.0000000010 (tie and even, remains at even)
1766 // 0.0000000010_100001 rounded to 0.0000000011 (> tie, rounds up)
1767 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1768 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 2.49).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1769 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1770 );
1771 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1772 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 2.50).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1773 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1774 );
1775 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1776 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). 2.51).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1777 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 3
1778 );
1779
1780 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1781 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2000.49f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1782 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2000.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1783 );
1784 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1785 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2000.50f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1786 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2000.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1787 );
1788 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1789 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2000.51f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1790 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2001.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1791 );
1792 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1793 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2001.49f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1794 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2001.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1795 );
1796 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1797 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2001.50f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1798 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1799 );
1800 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1801 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2001.51f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1802 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1803 );
1804 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1805 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2002.49f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1806 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1807 );
1808 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1809 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2002.50f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1810 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1811 );
1812 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1813 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2002.51f32).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1814 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2003.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1815 );
1816 }
1817
1818 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1819 #[allow(clippy::erasing_op, clippy::identity_op)]
1820 #[cfg_attr(miri, ignore)]
1821 fn round_to_even_f64rust-analyzer cargo half 2.7.1 binary16/test/round_to_even_f64().() {
1822 // smallest positive subnormal = 0b0.0000_0000_01 * 2^-14 = 2^-24
1823 let min_sub = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_bits().(1);
1824 let min_sub_f = (-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().24f64).exp2rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]exp2().();
1825 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(), min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().());
1826 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f64::fromrust-analyzer cargo half 2.7.1 binary16/impl#[f64][`From<f16>`]from().(min_sub).to_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]to_bits().(), min_sub_f.to_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]to_bits().());
1827
1828 // 0.0000000000_011111 rounded to 0.0000000000 (< tie, no rounding)
1829 // 0.0000000000_100000 rounded to 0.0000000000 (tie and even, remains at even)
1830 // 0.0000000000_100001 rounded to 0.0000000001 (> tie, rounds up)
1831 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1832 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 0.49).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1833 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 0
1834 );
1835 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1836 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 0.50).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1837 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 0
1838 );
1839 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1840 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 0.51).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1841 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 1
1842 );
1843
1844 // 0.0000000001_011111 rounded to 0.0000000001 (< tie, no rounding)
1845 // 0.0000000001_100000 rounded to 0.0000000010 (tie and odd, rounds up to even)
1846 // 0.0000000001_100001 rounded to 0.0000000010 (> tie, rounds up)
1847 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1848 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 1.49).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1849 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 1
1850 );
1851 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1852 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 1.50).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1853 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1854 );
1855 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1856 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 1.51).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1857 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1858 );
1859
1860 // 0.0000000010_011111 rounded to 0.0000000010 (< tie, no rounding)
1861 // 0.0000000010_100000 rounded to 0.0000000010 (tie and even, remains at even)
1862 // 0.0000000010_100001 rounded to 0.0000000011 (> tie, rounds up)
1863 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1864 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 2.49).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1865 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1866 );
1867 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1868 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 2.50).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1869 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 2
1870 );
1871 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1872 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(min_sub_f *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 2.51).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1873 min_sub.to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().() *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Mul<Self>`]mul(). 3
1874 );
1875
1876 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1877 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2000.49f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1878 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2000.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1879 );
1880 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1881 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2000.50f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1882 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2000.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1883 );
1884 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1885 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2000.51f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1886 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2001.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1887 );
1888 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1889 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2001.49f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1890 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2001.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1891 );
1892 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1893 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2001.50f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1894 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1895 );
1896 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1897 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2001.51f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1898 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1899 );
1900 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1901 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2002.49f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1902 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1903 );
1904 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1905 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2002.50f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1906 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2002.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1907 );
1908 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1909 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2002.51f64).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().(),
1910 f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(2003.0).to_bitsrust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_bits().()
1911 );
1912 }
1913
1914 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1915 fn arithmeticrust-analyzer cargo half 2.7.1 binary16/test/arithmetic().() {
1916 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE. +rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Add<Self>`]add(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE., f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.));
1917 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE. -rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Sub<Self>`]sub(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE., f16rust-analyzer cargo half 2.7.1 binary16/f16#::ZEROrust-analyzer cargo half 2.7.1 binary16/impl#[f16]ZERO.);
1918 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE. *rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]mul(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE., f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE.);
1919 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.) *rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Mul<Self>`]mul(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.), f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(4.));
1920 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE. /rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]div(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE., f16rust-analyzer cargo half 2.7.1 binary16/f16#::ONErust-analyzer cargo half 2.7.1 binary16/impl#[f16]ONE.);
1921 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(4.) /rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Div<Self>`]div(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.), f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(2.));
1922 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(4.) %rust-analyzer cargo half 2.7.1 binary16/impl#[f16][`Rem<Self>`]rem(). f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(3.), f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(1.));
1923 }
1924
1925 #[cfg(feature = "std")]
1926 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1927 fn formattingrust-analyzer cargo half 2.7.1 binary16/test/formatting().() {
1928 let f = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(0.1152344);
1929
1930 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.3}", f), "0.115");
1931 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.4}", f), "0.1152");
1932 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:+.4}", f), "+0.1152");
1933 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:>+10.4}", f), " +0.1152");
1934
1935 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.3?}", f), "0.115");
1936 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.4?}", f), "0.1152");
1937 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:+.4?}", f), "+0.1152");
1938 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:>+10.4?}", f), " +0.1152");
1939 }
1940
1941 impl quickcheckrust-analyzer cargo quickcheck 1.0.3 crate/::Arbitraryrust-analyzer cargo quickcheck 1.0.3 arbitrary/Arbitrary# for f16rust-analyzer cargo half 2.7.1 binary16/f16# {
1942 fn arbitraryrust-analyzer cargo half 2.7.1 binary16/test/impl#[f16][Arbitrary]arbitrary().(g: &mut quickcheckrust-analyzer cargo quickcheck 1.0.3 crate/::Genrust-analyzer cargo quickcheck 1.0.3 arbitrary/Gen#) -> Selfrust-analyzer cargo half 2.7.1 binary16/test/impl#[f16][Arbitrary] {
1943 f16rust-analyzer cargo half 2.7.1 binary16/f16#(u16::arbitraryrust-analyzer cargo quickcheck 1.0.3 arbitrary/impl#[u16][Arbitrary]arbitrary().(g))
1944 }
1945 }
1946
1947 #[quickcheckrust-analyzer cargo quickcheck_macros 1.0.0 quickcheck:]
1948 fn qc_roundtrip_f16_f32_is_identityrust-analyzer cargo half 2.7.1 binary16/test/qc_roundtrip_f16_f32_is_identity().(f: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> bool {
1949 let roundtrip = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(f.to_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f32().());
1950 if f.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
1951 roundtrip.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() && f.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().() ==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq(). roundtrip.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().()
1952 } else {
1953 f.0rust-analyzer cargo half 2.7.1 binary16/f16#0. ==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). roundtrip.0rust-analyzer cargo half 2.7.1 binary16/f16#0.
1954 }
1955 }
1956
1957 #[quickcheckrust-analyzer cargo quickcheck_macros 1.0.0 quickcheck:]
1958 fn qc_roundtrip_f16_f64_is_identityrust-analyzer cargo half 2.7.1 binary16/test/qc_roundtrip_f16_f64_is_identity().(f: f16rust-analyzer cargo half 2.7.1 binary16/f16#) -> bool {
1959 let roundtrip = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f64().(f.to_f64rust-analyzer cargo half 2.7.1 binary16/impl#[f16]to_f64().());
1960 if f.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() {
1961 roundtrip.is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().() && f.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().() ==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq(). roundtrip.is_sign_negativerust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_sign_negative().()
1962 } else {
1963 f.0rust-analyzer cargo half 2.7.1 binary16/f16#0. ==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). roundtrip.0rust-analyzer cargo half 2.7.1 binary16/f16#0.
1964 }
1965 }
1966
1967 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1968 fn test_maxrust-analyzer cargo half 2.7.1 binary16/test/test_max().() {
1969 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(0.0);
1970 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
1971 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.maxrust-analyzer cargo half 2.7.1 binary16/impl#[f16]max().(b), b);
1972
1973 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
1974 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(0.0);
1975 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.maxrust-analyzer cargo half 2.7.1 binary16/impl#[f16]max().(b), a);
1976
1977 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
1978 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
1979 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.maxrust-analyzer cargo half 2.7.1 binary16/impl#[f16]max().(b), b);
1980
1981 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
1982 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
1983 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.maxrust-analyzer cargo half 2.7.1 binary16/impl#[f16]max().(b), a);
1984
1985 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
1986 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
1987 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(a.maxrust-analyzer cargo half 2.7.1 binary16/impl#[f16]max().(b).is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
1988 }
1989
1990 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1991 fn test_minrust-analyzer cargo half 2.7.1 binary16/test/test_min().() {
1992 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(0.0);
1993 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
1994 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.minrust-analyzer cargo half 2.7.1 binary16/impl#[f16]min().(b), a);
1995
1996 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
1997 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(0.0);
1998 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.minrust-analyzer cargo half 2.7.1 binary16/impl#[f16]min().(b), b);
1999
2000 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
2001 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
2002 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.minrust-analyzer cargo half 2.7.1 binary16/impl#[f16]min().(b), b);
2003
2004 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::from_f32rust-analyzer cargo half 2.7.1 binary16/impl#[f16]from_f32().(42.0);
2005 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
2006 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.minrust-analyzer cargo half 2.7.1 binary16/impl#[f16]min().(b), a);
2007
2008 let a = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
2009 let b = f16rust-analyzer cargo half 2.7.1 binary16/f16#::NANrust-analyzer cargo half 2.7.1 binary16/impl#[f16]NAN.;
2010 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(a.minrust-analyzer cargo half 2.7.1 binary16/impl#[f16]min().(b).is_nanrust-analyzer cargo half 2.7.1 binary16/impl#[f16]is_nan().());
2011 }
2012 }