Skip to content

Commit dd57e18

Browse files
committed
Fix parsing of negative hex float literals in util
1 parent 2ef97dd commit dd57e18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libm/crates/util/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ fn parse<T: FromStr + FromStrRadix>(input: &[&str], idx: usize) -> T {
274274

275275
let msg = || format!("invalid {} input '{s}'", type_name::<T>());
276276

277-
if s.starts_with("0x") {
277+
if s.starts_with("0x") || s.starts_with("-0x") {
278278
return T::from_str_radix(s, 16).unwrap_or_else(|_| panic!("{}", msg()));
279279
}
280280

0 commit comments

Comments
 (0)