Number-to-ByteVector-conversion #44
1 changed files with 3 additions and 4 deletions
|
|
@ -413,10 +413,9 @@ impl VM {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
i::BVTON => access!(&instr.1[0], {
|
i::BVTON => access!(&instr.1[0], {
|
||||||
if let Datum::ByteVector(sbv) = **access!(&instr.1[0]) {
|
if let Datum::ByteVector(sbv) = &**access!(&instr.1[0]) {
|
||||||
let sf64 = f64::from_ne_bytes(sbv.try_into().unwrap());
|
let sf64 = f64::from_ne_bytes(sbv.clone().try_into().unwrap());
|
||||||
Ok::<Datum::Number, Float>(Datum::Number(Number::Flt(Float(sf64))));
|
Datum::Number(Number::Flt(Float(sf64))).into()
|
||||||
//Datum::Number(Number::Fra(Fraction(sf64 as isize, 1))).into()
|
|
||||||
} else {
|
} else {
|
||||||
e!("illegal argument to BVTON instruction");
|
e!("illegal argument to BVTON instruction");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue