From cb240e2ac6a32ed4d5023f95bc6f08b66a4ad9dc Mon Sep 17 00:00:00 2001 From: Angelica Schell Date: Wed, 14 Aug 2024 06:16:10 -0600 Subject: [PATCH] corrected bit width command line input so that it is optional" --- tools/data-conversion/src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/data-conversion/src/main.rs b/tools/data-conversion/src/main.rs index ab3397cd2..fbd7952e7 100644 --- a/tools/data-conversion/src/main.rs +++ b/tools/data-conversion/src/main.rs @@ -103,7 +103,7 @@ struct Arguments { bits: bool, /// optional for use with to_binary and from_binary - #[argh(option, short = 'w')] + #[argh(option, default = "0")] width: usize, } @@ -448,10 +448,7 @@ fn binary_to_float( let binary_value = u64::from_str_radix(binary_string, 2) .expect("Failed to parse binary string"); - // Interpret the integer as the binary representation of a floating-point number - let float_value = f64::from_bits(binary_value); - - let formated_float_str = format!("{:?}", float_value); + let formated_float_str = format!("{:?}", binary_value); if let Some(file) = filepath_send.as_mut() { // Write binary string to the file