File: test_exhaustive.rs

package info (click to toggle)
rust-fast-float2 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 272 kB
  • sloc: makefile: 2
file content (11 lines) | stat: -rw-r--r-- 325 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#[test]
#[ignore]
fn test_f32_exhaustive_ryu() {
    let mut buf = ryu::Buffer::new();
    for i in 0..0xFFFF_FFFF_u32 {
        let a: f32 = unsafe { core::mem::transmute(i) };
        let s = buf.format(a);
        let b: f32 = fast_float2::parse(s).unwrap();
        assert!(a == b || (a.is_nan() && b.is_nan()));
    }
}