Releases: starkat99/half-rs
Releases · starkat99/half-rs
1.8.1 [YANKED]
Yanked
Not recommended due to introducing compilation error in Rust versions that worked with 1.8.0.
Changed
- Now uses cargo resolver version 2 to prevent dev-dependencies from enabling
std
feature on optional dependencies.
Fixed
- Fixed compile failure when
std
feature is not enabled andnum-traits
is enabled under new resolver. Now properly useslibm
num-traits feature.
1.8.0
Changed
- Now always implements
Add
,Div
,Mul
,Neg
,Rem
, andSub
traits. Previously, these were only implemented under thenum-traits
feature. Keep in mind they still convert tof32
and back in the implementation. - Minimum supported Rust version is now 1.51.
- Made crate package REUSE compliant.
- Docs now use intra-doc links instead of manual (and hard to maintain) links.
- The following methods on both
f16
andbf16
are nowconst
:to_le_bytes
to_be_bytes
to_ne_bytes
from_le_bytes
from_be_bytes
from_ne_bytes
is_normal
classify
signum
Added
- Added optional implementations of
zerocopy
traitsAsBytes
andFromBytes
underzerocopy
cargo feature. By @samcrow. - Implemented the
core::iter::Product
andcore::iter::Sum
traits, with the same caveat as above about converting tof32
and back under the hood. - Added new associated const
NEG_ONE
to bothf16
andbf16
. - Added the following new methods on both
f16
andbf16
:copysign
max
min
clamp
Fixed
- Fixed a number of minor lints discovered due to improved CI.
1.7.1
1.7.0
Added
- Added optional implementations of
bytemuck
traitsZeroable
andPod
underbytemuck
cargo feature. By @charles-r-earp. - Added optional implementations of
num-traits
traitsToPrimitive
andFromPrimitive
undernum-traits
cargo feature. By @charles-r-earp. - Added implementations of
Binary
,Octal
,LowerHex
, andUpperHex
string format traits to format rawf16
/bf16
bytes to string.
Changed
Debug
trait implementation now formatsf16
/bf16
as float instead of raw bytes hex. Use newly implemented formatting traits to format in hex instead ofDebug
. Fixes #37.
1.6.0
1.5.0
1.4.1
1.4.0
Added
- Added a
bf16
type implementing the alternativebfloat16
16-bit floating point format. By @tspiteri. f16::from_bits
,f16::to_bits
,f16::is_nan
,f16::is_infinite
,f16::is_finite
,f16::is_sign_positive
, andf16::is_sign_negative
are nowconst
fns.slice::HalfBitsSliceExt
andslice::HalfBitsSliceExt
extension traits have been added for performing efficient reinterpret casts and conversions of slices to and from[f16]
and[bf16]
. These traits will use hardware SIMD conversion instructions when available and theuse-intrinsics
cargo feature is enabled.vec::HalfBitsVecExt
andvec::HalfFloatVecExt
extension traits have been added for performing efficient reinterpret casts to and fromVec<f16>
andVec<bf16>
. These traits are only available with thestd
cargo feature.prelude
has been added, for easy importing of most common functionality. Currently the prelude importsf16
,bf16
, and the new slice and vec extension traits.- New associated constants on
f16
type to replace deprecatedconsts
module.
Fixed
- Software conversion (when not using
use-intrinsics
feature) now matches hardware rounding by rounding to nearest, ties to even. Fixes #24, by @tspiteri. - NaN value conversions now behave like
f32
tof64
conversions, retaining sign. Fixes #23, by @tspiteri.
Changed
- Minimum rustc version bumped to 1.32.
- Runtime target host feature detection is now used if both
std
anduse-intrinsics
features are enabled and the compile target host does not support required features. - When
use-intrinsics
feature is enabled, will now always compile and run without error correctly regardless of compile target options.
Deprecated
consts
module and all its constants have been deprecated; use the associated constants onf16
instead.slice::from_bits
has been deprecated; useslice::HalfBitsSliceExt::reinterpret_cast
instead.slice::from_bits_mut
has been deprecated; useslice::HalfBitsSliceExt::reinterpret_cast_mut
instead.slice::to_bits
has been deprecated; useslice::HalfFloatSliceExt::reinterpret_cast
instead.slice::to_bits_mut
has been deprecated; useslice::HalfFloatSliceExt::reinterpret_cast_mut
instead.vec::from_bits
has been deprecated; usevec::HalfBitsVecExt::reinterpret_into
instead.vec::to_bits
has been deprecated; usevec::HalfFloatVecExt::reinterpret_into
instead.