half
Half-precision floating point f16 and bf16 types for Rust implementing the IEEE 754-2008 standard binary16 and bfloat16 types.
2.7.1
424M downloads/mo
#272 most downloaded on crates.io
VoidStarKat/half-rs
What this package is like to depend on
Last release 10 months ago
14 Oct 2025
Release timing varies
gaps range from 8 days to 11 months
Some releases are documented
notes for 8 of 29 stable releases
4 versions withdrawn
withdrawn after publishing
10 years old
33 releases · first in 2016
2 releases in the last 12 months
see the full history below
Release timeline
33 releases · Mar 2016 to Oct 2025Releases
latest 33-
2.7.114 Oct 2025Release notes
Open source →Fixed
loongarch64lsxhardware intrinsics forf16conversions now enabled only undernightlycargo feature, fixing compile errors on stable Rust.
-
2.7.009 Oct 2025 withdrawnRelease notes
Open source →Changed
zerocopyis now a required dependency. The optionalzerocopycrate feature is deprecated. This change is to ensure better code safety and prevent potential unsound behavior.- Git repository URL has changed due to GitHub user name change. Old URL is redirected.
Added
- New
num-traitsimplementations:Signedforf16andbf16. By @djsell. loongarch64lsxhardware intrinsic support forf16conversions. By @heiher.- Implemented
Weighttrait fromrandcrate forf16andbf16withrandoptional cargo feature. By @majian4work.
Fixed
minandmaxincorrectly propagateNaNvalues whenselfisNaN. Fixes #126, by @mgottscho.- Suppressed warnings from new
unnecessary_transmuteslint.
Removed
doc_auto_cfgfeature has been removed from docs.rs documentation due to removal of rust feature.
-
2.6.008 Apr 2025Release notes
Open source →Changed
- Fixed some incorrect minimum supported versions of dependencies that weren't caught due to
improperCargo.lock:num-traits0.2.14 -> 0.2.16zerocopy0.8.0 -> 0.8.23arbitrary1.3.2 -> 1.4.1
Added
f16andbf16now implementImmutableandKnownLayoutforzerocopycrate. By [@usamoi].
- Fixed some incorrect minimum supported versions of dependencies that weren't caught due to
-
2.5.014 Mar 2025Release notes
Open source →Changed
- Updated optional dependencies to latest major versions:
zercopy0.6 -> 0.8rand0.8 -> 0.9rand_distr0.4 -> 0.5rkyv0.7 -> 0.8- (dev)
criterion0.4 -> 0.5
- Minimum supported Rust version has been changed to 1.81 due to above dependency updates.
- Minor restructuring of included license file locations to be more consistent with crates ecosystem.
Added
- Added support for
arbitrarycrate. Fixes #110. By @FL33TW00D. - New
num-traitsimplementations:FromBytesandToBytesforf16andbf16. By @kpreid.
Fixed
- Suppressed unexpected_cfg lint warnings on newer versions of stable Rust.
- Resolved ambiguous rustdoc warnings due to new unstable
f16primitive in compiler.
- Updated optional dependencies to latest major versions:
-
2.4.106 Apr 2024Release notes
Open source →Fixed
- Missing macro import causing build failure on
no_std+allocfeature set. Fixes #107. - Clippy warning on nightly rust.
- Missing macro import causing build failure on
-
2.4.026 Feb 2024Release notes
Open source →Added
- Optional
rkyvsupport. Fixes #100, by @comath. - New
num-traitsimplementations:AsPrimitive<f16>forbf16andAsPrimitive<bf16>for
f16, allowing lossy conversions between the two types. By @charles-r-earp. Cargo.lockadded to vcs as is now recommended for library crates.
Fixed
- Remove some unit NaN conversion sign tests due to non-deterministic hardware. Fixes #103.
- Redundant import warnings on nightly Rust.
- Optional
-
2.3.126 Jun 2023 -
2.3.024 Jun 2023 withdrawnRelease notes
Open source →Added
- Support for Kani Rust Verifier. By @cameron1024.
- Support for
rand_distr::Distributionimplementations behindrand_distroptional cargo feature. By @coreylowman. - Floating point formatting options in
DisplayandDebugimplementations. By @eiz.
Changed
- Breaking Change Minimum supported Rust version is now 1.70.
- Breaking Change Minimum supported Rust version policy reverted to original policy of allowing minimum supported Rust version updates for minor releases instead of only major to avoid segmentation and allow optimizing hardware implementations without unnecessary major releases.
- Hardware intrinsics/assembly is finally available on stable Rust, including using hardware feature detection (
stdonly), including:- AArch64 now uses FP16 hardware instructions for conversions and math operations when available.
- x86/x86-64 now uses F16C hardware instructions for conversions (but no math operations) when available. Fixes #54.
Deprecated
use-intrinsicscargo feature no longer used. Hardware support will now always be used whenever possible. A future version may output deprecation warnings if this feature is enabled.
Fixed
- Improve code generation of
leading_zerosfunctions by inlining. By @encounter. Sumimplementation ofbf16incorrectly performed product instead of sum. By @wx-csy.- Compile failed when
serdecargo feature enabled butstdnot enabled. - Incorrect black boxing of benchmark tests.
- Rustdoc cfg display on docs.rs not getting enabled.
-
2.2.109 Jan 2023 -
2.2.031 Dec 2022Nothing published for this version
-
2.1.018 Jul 2022Nothing published for this version
-
2.0.021 Jun 2022Nothing published for this version
-
1.8.326 Feb 2024 -
1.8.222 Oct 2021Nothing published for this version
-
1.8.121 Oct 2021 withdrawnNothing published for this version
-
1.8.014 Oct 2021Nothing published for this version
-
1.7.117 Jan 2021Nothing published for this version
-
1.7.017 Jan 2021Nothing published for this version
-
1.6.010 May 2020Nothing published for this version
-
1.5.003 Mar 2020Nothing published for this version
-
1.4.110 Feb 2020Nothing published for this version
-
1.4.013 Oct 2019Nothing published for this version
-
1.3.104 Oct 2019Nothing published for this version
-
1.3.003 Oct 2018Nothing published for this version
-
1.2.003 Sep 2018Nothing published for this version
-
1.1.213 Jul 2018Nothing published for this version
-
1.1.125 Jun 2018 withdrawnNothing published for this version
-
1.1.017 Mar 2018Nothing published for this version
-
1.0.213 Jan 2018Nothing published for this version
-
1.0.130 Aug 2017Nothing published for this version
-
1.0.003 Feb 2017Nothing published for this version
-
0.1.108 Jan 2017Nothing published for this version
-
0.1.018 Mar 2016Nothing published for this version