Home
last modified time | relevance | path

Searched refs:from_f32 (Results 1 – 9 of 9) sorted by relevance

/external/rust/crates/half/src/
Dbfloat.rs52 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 …]
Dslice.rs487 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 …]
Dbinary16.rs76 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/
Dconvert.rs10 |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/
Dnewtype.rs52 let f = MyFloat::from_f32(std::f32::MAX).unwrap(); in test_to_primitive_128()
/external/rust/crates/num-traits/src/
Dcast.rs505 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/
Dser.rs321 } 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/
Dlib.rs310 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/
Dcast.rs351 assert_eq_from!(from_f32 from_f64); in newtype_from_primitive()