A crate that provides support for the half-precision floating point type.
This crate provides the
f16 type, which is an implementation of the IEEE 754-2008
floating point type. This 'half' precision floating point type is intended for efficient storage
where the full range and precision of a larger floating point value is not required. This is
especially useful for image storage formats.
f16 is primarily for efficient storage, floating point operations are not implemented.
Operations should be performed with
f32 or higher-precision types and converted to/from
Some hardware architectures provide support for 16-bit floating point conversions. Enable the
use-intrinsics feature to use LLVM intrinsics for hardware conversions. This crate does no
checks on whether the hardware supports the feature. This feature currently only works on
nightly Rust due to a compiler feature gate.
Deserialize traits is provided when the
feature is enabled. This adds a dependency on
serde crate so is an optional feature that works
on Rust 1.15 or newer.
The crate uses
#[no_std] by default, so can be used in embedded environments without using the
std library. A
std feature is available, which enables additional utilities using the
std library, such as the
vec module that provides zero-copy
Contains utility functions to convert between slices of
The 16-bit floating point type.