1# Changelog 2 3The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 4and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 5 6## [Unreleased] 7 8## [1.7.1] - 2021-01-17 <a name="1.7.1"></a> 9### Fixed 10- Docs.rs now generates docs for `bytemuck` and `num-traits` optional features. 11 12## [1.7.0] - 2021-01-17 <a name="1.7.0"></a> 13### Added 14- Added optional implementations of `bytemuck` traits `Zeroable` and `Pod` under `bytemuck` cargo 15 feature. By [@charles-r-earp]. 16- Added optional implementations of `num-traits` traits `ToPrimitive` and `FromPrimitive` under 17 `num-traits` cargo feature. By [@charles-r-earp]. 18- Added implementations of `Binary`, `Octal`, `LowerHex`, and `UpperHex` string format traits to 19 format raw `f16`/`bf16` bytes to string. 20 21### Changed 22- `Debug` trait implementation now formats `f16`/`bf16` as float instead of raw bytes hex. Use newly 23 implemented formatting traits to format in hex instead of `Debug`. Fixes [#37]. 24 25 26## [1.6.0] - 2020-05-09 <a name="1.6.0"></a> 27### Added 28- Added `LOG2_10` and `LOG10_2` constants to both `f16` and `bf16`, which were added to `f32` and 29 `f64` in the standard library in 1.43.0. By [@tspiteri]. 30- Added `to_le/be/ne_bytes` and `from_le/be/ne_bytes` to both `f16` and `bf16`, which were added to 31 the standard library in 1.40.0. By [@bzm3r]. 32 33## [1.5.0] - 2020-03-03 <a name="1.5.0"></a> 34### Added 35- Added the `alloc` feature to support the `alloc` crate in `no_std` environments. By [@zserik]. The 36 `vec` module is now available with either `alloc` or `std` feature. 37 38## [1.4.1] - 2020-02-10 <a name="1.4.1"></a> 39### Fixed 40- Added `#[repr(transparent)]` to `f16`/`bf16` to remove undefined behavior. By [@jfrimmel]. 41 42## [1.4.0] - 2019-10-13 <a name="1.4.0"></a> 43### Added 44- Added a `bf16` type implementing the alternative 45 [`bfloat16`](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format) 16-bit floating point 46 format. By [@tspiteri]. 47- `f16::from_bits`, `f16::to_bits`, `f16::is_nan`, `f16::is_infinite`, `f16::is_finite`, 48 `f16::is_sign_positive`, and `f16::is_sign_negative` are now `const` fns. 49- `slice::HalfBitsSliceExt` and `slice::HalfBitsSliceExt` extension traits have been added for 50 performing efficient reinterpret casts and conversions of slices to and from `[f16]` and 51 `[bf16]`. These traits will use hardware SIMD conversion instructions when available and the 52 `use-intrinsics` cargo feature is enabled. 53- `vec::HalfBitsVecExt` and `vec::HalfFloatVecExt` extension traits have been added for 54 performing efficient reinterpret casts to and from `Vec<f16>` and `Vec<bf16>`. These traits 55 are only available with the `std` cargo feature. 56- `prelude` has been added, for easy importing of most common functionality. Currently the 57 prelude imports `f16`, `bf16`, and the new slice and vec extension traits. 58- New associated constants on `f16` type to replace deprecated `consts` module. 59 60### Fixed 61- Software conversion (when not using `use-intrinsics` feature) now matches hardware rounding 62 by rounding to nearest, ties to even. Fixes [#24], by [@tspiteri]. 63- NaN value conversions now behave like `f32` to `f64` conversions, retaining sign. Fixes [#23], 64 by [@tspiteri]. 65 66### Changed 67- Minimum rustc version bumped to 1.32. 68- Runtime target host feature detection is now used if both `std` and `use-intrinsics` features are 69 enabled and the compile target host does not support required features. 70- When `use-intrinsics` feature is enabled, will now always compile and run without error correctly 71 regardless of compile target options. 72 73### Deprecated 74- `consts` module and all its constants have been deprecated; use the associated constants on `f16` 75 instead. 76- `slice::from_bits` has been deprecated; use `slice::HalfBitsSliceExt::reinterpret_cast` instead. 77- `slice::from_bits_mut` has been deprecated; use `slice::HalfBitsSliceExt::reinterpret_cast_mut` 78 instead. 79- `slice::to_bits` has been deprecated; use `slice::HalfFloatSliceExt::reinterpret_cast` instead. 80- `slice::to_bits_mut` has been deprecated; use `slice::HalfFloatSliceExt::reinterpret_cast_mut` 81 instead. 82- `vec::from_bits` has been deprecated; use `vec::HalfBitsVecExt::reinterpret_into` instead. 83- `vec::to_bits` has been deprecated; use `vec::HalfFloatVecExt::reinterpret_into` instead. 84 85## [1.3.1] - 2019-10-04 <a name="1.3.1"></a> 86### Fixed 87- Corrected values of constants `EPSILON`, `MAX_10_EXP`, `MAX_EXP`, `MIN_10_EXP`, and `MIN_EXP` 88 in `consts` module, as well as setting `consts::NAN` to match value of `f32::NAN` converted to 89 `f16`. By [@tspiteri]. 90 91## [1.3.0] - 2018-10-02 <a name="1.3.0"></a> 92### Added 93- `slice::from_bits_mut` and `slice::to_bits_mut` for conversion between mutable `u16` and `f16` 94 slices. Fixes [#16], by [@johannesvollmer]. 95 96## [1.2.0] - 2018-09-03 <a name="1.2.0"></a> 97### Added 98- `slice` and optional `vec` (only included with `std` feature) modules for conversions between 99 `u16` and `f16` buffers. Fixes [#14], by [@johannesvollmer]. 100- `to_bits` added to replace `as_bits`. Fixes [#12], by [@tspiteri]. 101### Fixed 102- `serde` optional dependency no longer uses its default `std` feature. 103### Deprecated 104- `as_bits` has been deprecated; use `to_bits` instead. 105- `serialize` cargo feature is deprecated; use `serde` instead. 106 107## [1.1.2] - 2018-07-12 <a name="1.1.2"></a> 108### Fixed 109- Fixed compilation error in 1.1.1 on rustc < 1.27, now compiles again on rustc >= 1.10. Fixes 110 [#11]. 111 112## [1.1.1] - 2018-06-24 - **Yanked** <a name="1.1.1"></a> 113### ***Yanked*** 114*Not recommended due to introducing compilation error on rustc versions prior to 1.27.* 115### Fixed 116- Fix subnormal float conversions when `use-intrinsics` is not enabled. By [@Moongoodboy-K]. 117 118## [1.1.0] - 2018-03-17 <a name="1.1.0"></a> 119### Added 120- Made `to_f32` and `to_f64` public. Fixes [#7], by [@PSeitz]. 121 122## [1.0.2] - 2018-01-12 <a name="1.0.2"></a> 123### Changed 124- Update behavior of `is_sign_positive` and `is_sign_negative` to match the IEEE754 conforming 125 behavior of the standard library since Rust 1.20.0. Fixes [#3], by [@tspiteri]. 126- Small optimization on `is_nan` and `is_infinite` from [@tspiteri]. 127### Fixed 128- Fix comparisons of +0 to -0 and comparisons involving negative numbers. Fixes [#2], by 129 [@tspiteri]. 130- Fix loss of sign when converting `f16` and `f32` to `f16`, and case where `f64` NaN could be 131 converted to `f16` infinity instead of NaN. Fixes [#5], by [@tspiteri]. 132 133## [1.0.1] - 2017-08-30 <a name="1.0.1"></a> 134### Added 135- More README documentation. 136- Badges and categories in crate metadata. 137### Changed 138- `serde` dependency updated to 1.0 stable. 139- Writing changelog manually. 140 141## [1.0.0] - 2017-02-03 <a name="1.0.0"></a> 142### Added 143- Update to `serde` 0.9 and stable Rust 1.15 for `serialize` feature. 144 145## [0.1.1] - 2017-01-08 <a name="0.1.1"></a> 146### Added 147- Add `serde` support under new `serialize` feature. 148### Changed 149- Use `no_std` for crate by default. 150 151## 0.1.0 - 2016-03-17 <a name="0.1.0"></a> 152### Added 153- Initial release of `f16` type. 154 155[#2]: https://github.com/starkat99/half-rs/issues/2 156[#3]: https://github.com/starkat99/half-rs/issues/3 157[#5]: https://github.com/starkat99/half-rs/issues/5 158[#7]: https://github.com/starkat99/half-rs/issues/7 159[#11]: https://github.com/starkat99/half-rs/issues/11 160[#12]: https://github.com/starkat99/half-rs/issues/12 161[#14]: https://github.com/starkat99/half-rs/issues/14 162[#16]: https://github.com/starkat99/half-rs/issues/16 163[#23]: https://github.com/starkat99/half-rs/issues/23 164[#24]: https://github.com/starkat99/half-rs/issues/24 165[#37]: https://github.com/starkat99/half-rs/issues/37 166 167[@tspiteri]: https://github.com/tspiteri 168[@PSeitz]: https://github.com/PSeitz 169[@Moongoodboy-K]: https://github.com/Moongoodboy-K 170[@johannesvollmer]: https://github.com/johannesvollmer 171[@jfrimmel]: https://github.com/jfrimmel 172[@zserik]: https://github.com/zserik 173[@bzm3r]: https://github.com/bzm3r 174[@charles-r-earp]: https://github.com/charles-r-earp 175 176 177[Unreleased]: https://github.com/starkat99/half-rs/compare/v1.7.1...HEAD 178[1.7.1]: https://github.com/starkat99/half-rs/compare/v1.7.0...v1.7.1 179[1.7.0]: https://github.com/starkat99/half-rs/compare/v1.6.0...v1.7.0 180[1.6.0]: https://github.com/starkat99/half-rs/compare/v1.5.0...v1.6.0 181[1.5.0]: https://github.com/starkat99/half-rs/compare/v1.4.1...v1.5.0 182[1.4.1]: https://github.com/starkat99/half-rs/compare/v1.4.0...v1.4.1 183[1.4.0]: https://github.com/starkat99/half-rs/compare/v1.3.1...v1.4.0 184[1.3.1]: https://github.com/starkat99/half-rs/compare/v1.3.0...v1.3.1 185[1.3.0]: https://github.com/starkat99/half-rs/compare/v1.2.0...v1.3.0 186[1.2.0]: https://github.com/starkat99/half-rs/compare/v1.1.2...v1.2.0 187[1.1.2]: https://github.com/starkat99/half-rs/compare/v1.1.1...v1.1.2 188[1.1.1]: https://github.com/starkat99/half-rs/compare/v1.1.0...v1.1.1 189[1.1.0]: https://github.com/starkat99/half-rs/compare/v1.0.2...v1.1.0 190[1.0.2]: https://github.com/starkat99/half-rs/compare/v1.0.1...v1.0.2 191[1.0.1]: https://github.com/starkat99/half-rs/compare/v1.0.0...v1.0.1 192[1.0.0]: https://github.com/starkat99/half-rs/compare/v0.1.1...v1.0.0 193[0.1.1]: https://github.com/starkat99/half-rs/compare/v0.1.0...v0.1.1 194