lib-misc-utils · crate

half

Libraryenvironment

Kinogaki's own half, published under the crates.io name so the frozen naga resolves to it through [patch.crates-io].

Repository
lib-misc-utils (kinogaki/lib-misc-utils)
Folder
libs/lib-misc-utils/crates/half
Source
4 files, 1,039 lines
Tests
1 file, 283 lines
depends onused by tests alonedependencies for tests alone are listed below, not drawn

What it is

Kinogaki's own half, published under the crates.io name so the frozen naga resolves to it through [patch.crates-io]. It is not upstream half: it has the IEEE 754 binary16 type f16 with what naga calls (its literals and constant folding), and with the num-traits feature our num-traits implementations for it.

Conversions are bit-exact IEEE 754 (round to nearest, ties to even; NaN stays NaN with its payload's top bits and the quiet bit set), checked over all 65,536 values and every rounding boundary (tests/conversions.rs). Arithmetic computes in f32 and rounds once to f16; for +, -, ×, ÷ and % that is the correctly rounded binary16 result (f32 has more than twice binary16's precision plus two bits, so the double rounding is harmless).

Depends on

CrateRepositoryAsWhat it is
num-traitslib-misc-utilsnormalKinogaki's own numeric traits, published under the crates.io name num-traits so the frozen naga and our half resolve to it through [patch.crates-io].

Third-party

None.

Used by

None.

Third-party crates using it

naga

Modules

Public types and traits

At the crate root

Structs f16

By module: 1 public type and trait in 1 module

f16_type f16