another attempt to make BVTON
Some checks failed
per-push tests / build (pull_request) Failing after 39s
per-push tests / test-frontend (pull_request) Has been skipped
per-push tests / timed-decomposer-parse (pull_request) Has been skipped
per-push tests / test-utility (pull_request) Has been skipped
per-push tests / test-backend (pull_request) Has been skipped
Some checks failed
per-push tests / build (pull_request) Failing after 39s
per-push tests / test-frontend (pull_request) Has been skipped
per-push tests / timed-decomposer-parse (pull_request) Has been skipped
per-push tests / test-utility (pull_request) Has been skipped
per-push tests / test-backend (pull_request) Has been skipped
This commit is contained in:
parent
37b21935cc
commit
8195d74614
1 changed files with 4 additions and 2 deletions
|
|
@ -16,7 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
use organelle::{Fraction, Number, Numeric};
|
use organelle::{Float, Fraction, Number, Numeric};
|
||||||
|
|
||||||
use crate::hmap::QuickMap;
|
use crate::hmap::QuickMap;
|
||||||
use crate::stackstack::StackStack;
|
use crate::stackstack::StackStack;
|
||||||
|
|
@ -406,7 +406,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]) {
|
||||||
Datum::Number(Number::Fra(Fraction(f64::from_ne_bytes(sbv) as isize, 1))).into()
|
let sf64 = f64::from_ne_bytes(sbv.try_into().unwrap());
|
||||||
|
Ok::<Datum::Number, Float>(Datum::Number(Number::Flt(Float(sf64))));
|
||||||
|
//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