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. While a
std feature is available, at present there are no additional
changes when the feature is enabled and is merely provided for forward-compatibility.
The 16-bit floating point type.