1# Changelog
2
3Notes significant changes to lexical-core.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8## [Unreleased]
9- Updated cfg_if version.
10- Downgraded rand to fix proptests.
11- Fixed a bug on newer Rustc versions where `slice::sort` is not present in `no_std`.
12- Added a feature `libm` which enables stable `no_std` use.
13- Patched an implementation of insert_many due to a security advisory which does not affect lexical.
14
15## [0.7.5] 2021-02-21
16### Changed
17- Fixed issue with `integer::BITS` conflicting with new compilers.
18
19## [0.7.4] 2020-01-27
20### Changed
21- Changed NumberFormat to use 64-bit flags.
22- Added `NO_INTEGER_LEADING_ZEROS` and `NO_FLOAT_LEADING_ZEROS` NumberFormat flags.
23- Added `InvalidLeadingZeros` to ErrorCode enum.
24- Added `validate_no_leading_zeros` to reject invalid inputs.
25- Added new leading zero checks to all pre-defined NumberFormat constants.
26
27## [0.7.3] 2020-01-26
28### Changed
29- Updated the format bitflags to make matches more efficient, allowing jumptables to be used for most situations.
30
31## [0.7.2] 2020-01-25
32### Changed
33- Fixed a regression in parsing special values.
34
35## [0.7.1] 2020-01-23
36### Added
37- Added `format` feature to control parsing integers and floats from number specifications.
38- Added the `NumberFormat` bitflags to control Number format specifications. These flags control how a number is parsed, including enabling the use of digit separators, requiring integer or fraction digits, and more.
39- Added pre-defined constants for `NumberFormat` (`RUST_STRING`, `PYTHON_LITERAL`) to avoid compiling formats when not needed.
40- Added the `FromLexicalFormat` and `FromLexicalLossyFormat` traits with the `format` feature, which enable you to specify the number format during parsing.
41- Implemented algorithms in terms of generic iterators, to allow skipping digit separators.
42- Implemented data interfaces to simplify parsing and validating number format.
43- Added more values to `ErrorCode` to signify more parse failures.
44
45### Changed
46- Changed `ErrorCode::MissingFraction` to be `ErrorCode::MissingMantissa`, to differentiate between missing integers, missing fractions, and missing significant digits (mantissa).
47- Remove `RawFloatState` and `FloatState` and replaced it logically with `FastDataInterface` and `SlowDataInterface`, allowing format-defined parsing.
48
49## [0.7.0] - 2020-01-07
50### Changed
51- Updated `arrayvec` and `static-assertions` versions.
52- Removed support for Rustc versions below 1.37.0.
53
54## [0.6.3] - 2019-10-08
55### Changed
56- Forced version `0.1.9` for cfg-if to support older Rustc versions.
57- Documented dependency versioning and upgrade procedure.
58
59## [0.6.2] - 2019-09-22
60### Changed
61- Fixed a bug causing compilation issues on MSVC.
62
63## [0.6.1] - 2019-09-16
64### Changed
65- Removed panic handler, allowing use in `no_std` environments.
66
67## [0.6.0] - 2019-09-08
68### Added
69- Added `get/set_exponent_default_char`, `get/set_exponent_backup_char`, and `get/set_float_rounding`, to allow validation logic for config variables.
70- Added the `write*` functions, which replace the `*toa` methods.
71- Added `parse*` functions, which replace the `ato*` methods.
72- Added tests to ensure lexical-core works with proc-macros.
73- Substituted rust-stackvector with arrayvec, which has better support.
74
75### Removed
76- Removed `EXPONENT_DEFAULT_CHAR`, `EXPONENT_BACKUP_CHAR`, and `FLOAT_ROUNDING`.
77- Removed all expanded API signatures for `ato*` to `*toa`, since these were for compatibility with the C-API and were therefore redundant.
78- Removed the FFI submodule, and moved all functionality to the `lexical-capi` crate.
79
80## [0.5.0] - 2019-08-20
81### Added
82- Added ffi::Result, an FFI-compatible tagged union, to store results for FFI-compatible functions.
83- Added `MAX_*_SIZE_BASE10` constants, to determine the maximum size in bytes a formatted type will take in base 10.
84- Added `ato*_partial` functions, which parse until an invalid digit is found, returning the value and number of processed digits.
85
86### Changed
87- Improved code generation and reduced binary bloat. There are a few algorithmic differences that make this possible, but the parsers now generally extract the float subcomponents first, then parsed known-good data after for enhanced performance.
88- Updated the benchmarks and benchmark results.
89- Add variants for lexical_core::ErrorCode. Added `Underflow`, to detect numerical underflow, `EmptyFraction`, to detect floats with an empty integer and fraction components, and `EmptyExponent`, to detect floats with no value following the exponent character.
90- Changed Result to use `std::result::Result`.
91- Fixed proptests and added more comprehensive proptests thanks to @dangrabcad.
92- Moved FFI-compatible code to the public `ffi` module.
93- Removed `*_slice` from functions in the public API, since there is no naming conflict with FFI code.
94- Removed `*_ffi` and `*_FFI` from public functions and constants.
95- Optimized the itoa exporters using specialized optimizations for the type size and number of digits. The resulting performance excels for all values, providing 2-3x performance improvements, with exceptional performance for values with a small number of digits.
96- Optimized integer division algorithm based off the compiler-builtins crate to avoid redundant calls to an expensive compiler intrinsic (`__udivmodti4`).
97- Optimized the atoi algorithm for 128-bit integers by using intermediary 64-bit integers, leading to performance boosts of up to 30x.
98
99### Removed
100- Removed the unchecked parsers from the public API. `try_parse*` has been replaced with `parse*`.
101- Removed ErrorCode::Success, since with the new result types it was redundant.
102
103## [0.4.3] - 2019-06-26
104- Fixed a bug (issue #20) leading to incorrect float parsing (1 ULP error) for slow-path algorithms containing floats with a trailing 0-digit in the fraction component (discovery by @dangrabcad). Added in comprehensive unittests to avoid future regressions.
105- Fixed CI for older Rustc versions due to issues with the `edition` keyword.
106- Updated dependencies (credit to @junhoo).
107- Updated the benchmarks for float and integer formatting to use `Write::write_fmt` rather than `to_string` to avoid heap allocation leading to misleading results (credit to @RazrFalcon).
108
109## [0.4.2] - 2019-06-24
110### Added
111- Comprehensive continuous integration unittests for numerous platforms, based off the [trust](https://github.com/japaric/trust) templates.
112- Added known issue for a non-default, lossy setting on armv6 architectures.
113
114### Changed
115- Bug fix for 32-bit targets.
116
117## [0.4.1] - 2019-06-20
118### Added
119- Backwards compatible support for Rustc 1.24.0.
120
121### Changed
122- Worked around a bug in the internal float formatter where `&arr[idx]` creates a local copy in Rust versions before 1.28.0, creating a dangling reference after the scope ends. For more details, see `cached_grisu_power` in `/lexical-core/src/ftoa/grisu2.rs` .
123