Closed
Description
Encoding any negative number with to_str_radix
does not produce the correct result when decoding with from_str_radix
since (my guess) #18536.
use std::f32::{from_str_hex, to_str_hex};
use std::num::from_str_radix;
fn main() {
let x = -1.0f32;
let h = to_str_hex(x);
println!("hex = {}", h);
assert_eq!(from_str_radix::<f32>(h.as_slice(), 16).unwrap(), x);
}
Metadata
Metadata
Assignees
Labels
No labels