Module hex_float

Source
Expand description

Utilities for working with hex float formats.

Structsยง

HexFloatParseError
Hexf
Format a floating point number as its IEEE hex (%a) representation.
Parsed ๐Ÿ”’
A parsed finite and unsigned floating point number.

Functionsยง

dec_digit ๐Ÿ”’
fmt_any_hex ๐Ÿ”’
hex_digit ๐Ÿ”’
hf16
Construct a 16-bit float from hex float representation (C-style)
hf32
Construct a 32-bit float from hex float representation (C-style)
hf64
Construct a 64-bit float from hex float representation (C-style)
hf128
Construct a 128-bit float from hex float representation (C-style)
parse_any
Parse any float from hex to its bitwise representation.
parse_finite ๐Ÿ”’
parse_hex ๐Ÿ”’
Parse a hexadecimal float x
parse_hex_exact
Parses any float to its bitwise representation, returning an error if it cannot be represented exactly
shr2_round ๐Ÿ”’
Divide by 4, rounding with the given mode
shr_odd_rounding ๐Ÿ”’
Shift right, rounding all inexact divisions to the nearest odd number E.g. (0 >> 4) -> 0, (1..=31 >> 4) -> 1, (32 >> 4) -> 2, โ€ฆ
u128_ilog2 ๐Ÿ”’
u128::ilog2