From bbdb7a0b9e3c6beec0b48b9873b1144074a94274 Mon Sep 17 00:00:00 2001 From: Angelica Schell Date: Wed, 30 Oct 2024 10:24:19 -0400 Subject: [PATCH] Removed functions that didn't belong --- .../data-conversion/src/float_special_values | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/tools/data-conversion/src/float_special_values b/tools/data-conversion/src/float_special_values index 282e9bf10..c717835e8 100644 --- a/tools/data-conversion/src/float_special_values +++ b/tools/data-conversion/src/float_special_values @@ -69,37 +69,4 @@ impl IntermediateRepresentation { pub fn is_zero(&self) -> bool { self.exponent == 0 && self.mantissa.is_zero() } - - // Function to create from binary string (updated with special cases handling) - pub fn from_binary( - binary_string: &str, - bit_width: usize, - twos_comp: bool, - ) -> IntermediateRepresentation { - let sign; - if !twos_comp { - sign = false; - } else { - sign = binary_string.starts_with('1'); - } - - let binary_value = BigUint::from_str_radix(binary_string, 2) - .expect("Invalid binary string"); - - let mantissa = if sign { - // Calculate the two's complement for negative values - let max_value = BigUint::from(1u64) << bit_width; - &max_value - &binary_value - } else { - binary_value - }; - - let exponent = 0; // For fixed-point or other representations, you may adjust this later - - IntermediateRepresentation { - sign, - mantissa, - exponent, - } - } }