Crate hexf [] [src]

Hexadecimal float support for Rust 1.15 or later.

#[macro_use] extern crate hexf;

assert_eq!(hexf32!("0x1.99999ap-4"), 0.1f32);
assert_eq!(hexf64!("0x1.999999999999ap-4"), 0.1f64);

Macros

hexf32

Expands to a f32 value with given hexadecimal representation.

hexf64

Expands to a f64 value with given hexadecimal representation.

Structs

ParseHexfError

An opaque error type from parse_hexf32 and parse_hexf64.

Functions

parse_hexf32

Tries to parse a hexadecimal float literal to f32. The underscore is allowed only when allow_underscore is true.

parse_hexf64

Tries to parse a hexadecimal float literal to f64. The underscore is allowed only when allow_underscore is true.