Searched refs:from_f32 (Results 1 – 9 of 9) sorted by relevance
/external/rust/crates/half/src/ |
D | bfloat.rs | 52 pub fn from_f32(value: f32) -> bf16 { in from_f32() method 332 bf16::from_f32(-1.0) in signum() 334 bf16::from_f32(1.0) in signum() 482 bf16::from_f32(f32::from(x)) in from() 490 bf16::from_f32(f32::from(x)) in from() 596 f32::from_str(src).map(bf16::from_f32) in from_str() 688 n.to_f32().map(|x| Self::from_f32(x)) in from_i64() 691 n.to_f32().map(|x| Self::from_f32(x)) in from_u64() 694 n.to_f32().map(|x| Self::from_f32(x)) in from_i8() 697 n.to_f32().map(|x| Self::from_f32(x)) in from_u8() [all …]
|
D | slice.rs | 487 self[i] = bf16::from_f32(*f); in convert_from_f32_slice() 718 f16::from_f32(1.), in slice_convert_f16_f32() 719 f16::from_f32(2.), in slice_convert_f16_f32() 720 f16::from_f32(3.), in slice_convert_f16_f32() 721 f16::from_f32(4.), in slice_convert_f16_f32() 722 f16::from_f32(5.), in slice_convert_f16_f32() 723 f16::from_f32(6.), in slice_convert_f16_f32() 724 f16::from_f32(7.), in slice_convert_f16_f32() 725 f16::from_f32(8.), in slice_convert_f16_f32() 739 f16::from_f32(1.), in slice_convert_f16_f32() [all …]
|
D | binary16.rs | 76 n.to_f32().map(|x| Self::from_f32(x)) in from_i64() 79 n.to_f32().map(|x| Self::from_f32(x)) in from_u64() 82 n.to_f32().map(|x| Self::from_f32(x)) in from_i8() 85 n.to_f32().map(|x| Self::from_f32(x)) in from_u8() 88 n.to_f32().map(|x| Self::from_f32(x)) in from_i16() 91 n.to_f32().map(|x| Self::from_f32(x)) in from_u16() 94 n.to_f32().map(|x| Self::from_f32(x)) in from_i32() 97 n.to_f32().map(|x| Self::from_f32(x)) in from_u32() 99 fn from_f32(n: f32) -> Option<Self> { in from_f32() method 100 n.to_f32().map(|x| Self::from_f32(x)) in from_f32() [all …]
|
/external/rust/crates/half/benches/ |
D | convert.rs | 10 |b: &mut Bencher<'_>, i: &f32| b.iter(|| f16::from_f32(*i)), in bench_f32_to_f16() 181 .map(|(i, _)| f16::from_f32(i as f32)) in bench_slice_f16_to_f32() 234 |b: &mut Bencher<'_>, i: &f32| b.iter(|| bf16::from_f32(*i)), in bench_f32_to_bf16()
|
/external/rust/crates/num-derive/tests/ |
D | newtype.rs | 52 let f = MyFloat::from_f32(std::f32::MAX).unwrap(); in test_to_primitive_128()
|
/external/rust/crates/num-traits/src/ |
D | cast.rs | 505 fn from_f32(n: f32) -> Option<Self> { in from_f32() method 581 fn from_f32(n: f32) -> Option<$T> { 670 fn from_f32(f32);
|
/external/rust/crates/serde_cbor/src/ |
D | ser.rs | 321 } else if f32::from(f16::from_f32(value)) == value { in serialize_f32() 323 (&mut buf[1..]).copy_from_slice(&f16::from_f32(value).to_bits().to_be_bytes()); in serialize_f32()
|
/external/rust/crates/num-derive/src/ |
D | lib.rs | 310 fn from_f32(n: f32) -> Option<Self> { in from_primitive() 311 <#inner_ty as #import::FromPrimitive>::from_f32(n).map(#name) in from_primitive()
|
/external/rust/crates/num-traits/tests/ |
D | cast.rs | 351 assert_eq_from!(from_f32 from_f64); in newtype_from_primitive()
|