Skip to content

Commit

Permalink
corrected bit width command line input so that it is optional"
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelica-Schell committed Aug 14, 2024
1 parent b44ea8c commit cb240e2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tools/data-conversion/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cb240e2

Please sign in to comment.