From 8195d746143392c75f92cd9954fd89c19968b7f0 Mon Sep 17 00:00:00 2001 From: Kolby Heacock Date: Thu, 4 Dec 2025 11:14:07 -0700 Subject: [PATCH] another attempt to make BVTON --- hyphae/src/vm.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hyphae/src/vm.rs b/hyphae/src/vm.rs index 8b23a34..dcb7277 100644 --- a/hyphae/src/vm.rs +++ b/hyphae/src/vm.rs @@ -16,7 +16,7 @@ */ -use organelle::{Fraction, Number, Numeric}; +use organelle::{Float, Fraction, Number, Numeric}; use crate::hmap::QuickMap; use crate::stackstack::StackStack; @@ -406,7 +406,9 @@ impl VM { i::BVTON => 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(Number::Flt(Float(sf64)))); + //Datum::Number(Number::Fra(Fraction(sf64 as isize, 1))).into() } else { e!("illegal argument to BVTON instruction"); }