1
Fork 0

Enable const evaluation for f16 and f128

This excludes casting, which needs more tests.
This commit is contained in:
Trevor Gross 2024-06-13 08:11:16 -05:00
parent 921645c737
commit c906d2e428
2 changed files with 22 additions and 2 deletions

View file

@ -69,6 +69,13 @@ impl<Prov: Provenance> fmt::LowerHex for Scalar<Prov> {
}
}
impl<Prov> From<Half> for Scalar<Prov> {
#[inline(always)]
fn from(f: Half) -> Self {
Scalar::from_f16(f)
}
}
impl<Prov> From<Single> for Scalar<Prov> {
#[inline(always)]
fn from(f: Single) -> Self {
@ -83,6 +90,13 @@ impl<Prov> From<Double> for Scalar<Prov> {
}
}
impl<Prov> From<Quad> for Scalar<Prov> {
#[inline(always)]
fn from(f: Quad) -> Self {
Scalar::from_f128(f)
}
}
impl<Prov> From<ScalarInt> for Scalar<Prov> {
#[inline(always)]
fn from(ptr: ScalarInt) -> Self {