This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 11//! Utilities for working with hex float formats.
22
3- #![ allow( dead_code) ] // FIXME: remove once this gets used
4-
53use core:: fmt;
64
75use 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) ]
1615pub 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
You can’t perform that action at this time.
0 commit comments