float-format 0.1.3

A library for custom floating point number format
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use float_format::Components;

#[test]
fn print_debug() {
    let c = Components::new(
        Some(true),
        "0b101011001110",
        "0b111011010011000",
    ).unwrap();

    assert_eq!(format!("{:?}", c), "Components { sign: -, exp: 101011001110, mant: 111011010011000 }");
    assert_eq!(format!("{:#?}", c), "Components {\n    sign: -,\n    exp: 101011001110,\n    mant: 111011010011000,\n}");
}