Skip to content

Commit 020db46

Browse files
committed
Uncomment some hex float tests that should work now
1 parent 2795848 commit 020db46

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/math/support/hex_float.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Utilities for working with hex float formats.
22
3-
#![allow(dead_code)] // FIXME: remove once this gets used
4-
53
use core::fmt;
64

75
use super::{Float, f32_from_bits, f64_from_bits};
@@ -13,6 +11,7 @@ pub const fn hf16(s: &str) -> f16 {
1311
}
1412

1513
/// Construct a 32-bit float from hex float representation (C-style)
14+
#[allow(unused)]
1615
pub const fn hf32(s: &str) -> f32 {
1716
f32_from_bits(parse_any(s, 32, 23) as u32)
1817
}
@@ -548,14 +547,12 @@ mod parse_tests {
548547

549548
#[test]
550549
fn test_macros() {
551-
// FIXME(msrv): enable once parsing works
552-
// #[cfg(f16_enabled)]
553-
// assert_eq!(hf16!("0x1.ffp+8").to_bits(), 0x5ffc_u16);
550+
#[cfg(f16_enabled)]
551+
assert_eq!(hf16!("0x1.ffp+8").to_bits(), 0x5ffc_u16);
554552
assert_eq!(hf32!("0x1.ffep+8").to_bits(), 0x43fff000_u32);
555553
assert_eq!(hf64!("0x1.ffep+8").to_bits(), 0x407ffe0000000000_u64);
556-
// FIXME(msrv): enable once parsing works
557-
// #[cfg(f128_enabled)]
558-
// assert_eq!(hf128!("0x1.ffep+8").to_bits(), 0x4007ffe0000000000000000000000000_u128);
554+
#[cfg(f128_enabled)]
555+
assert_eq!(hf128!("0x1.ffep+8").to_bits(), 0x4007ffe0000000000000000000000000_u128);
559556
}
560557
}
561558

0 commit comments

Comments
 (0)