Minor Changes
- Update documentation to make the Examples section more clear.
Major Changes
- Adds a new function
CountDigits::checked_count_digits_radix()
which is a non-panicking version ofCountDigits::count_digits_radix()
.
Major Changes
- Fixes an issue where primitive integer implementations were not properly panicking
for passing radix 0 and 1 to the
CountDigits::count_digits_radix()
function.
Minor Changes
- Update documentation clarifying the Radix type.
Minor Changes
- Updates the documentation to more closely match the changes in v0.3.0
Major Changes
- Changes the return type of
CountDigits::count_digits()
fromu32
tousize
. - Changes the return type of
CountDigits::count_digits_radix()
fromu32
tousize
. - Implements
CountDigits
for references to types that implementCountDigits
.
Adds
- Adds new tests for reference types.
The rationale behind changing the return types listed above is that bit-related functions
typically return u32
and take u32
as parameters, but usize
is often used for formatting
and display.
In this way, the inherently bit-related functions, count_bits()
,
count_octal_digits()
, and count_hex_digits()
continue to return u32
and can be used
with the BITS
constants as well as bit-shifting functions without the need to cast.
Likewise, the count_digits()
function as well as the count_digits_radix()
function can be used
as arguments for formatting without the need to cast.
I believe this provides the best compromise,
allowing the trait to be used smoothly across various use cases without the as
keyword.
Changes
- Includes only the files necessary to build the crate for publishing in the Cargo.toml.
Improves
- Refactors count_octal_digits to use ilog2 internally.
- Refactors count_hex_digits to use ilog2 internally.
The v0.2.4 benchmarks show that ilog2
, used by count_bits
, has the same performance regardless of the size of the integer input.
The v0.2.4 benchmarks show that count_octal_digits
and count_hex_digits
functions, which were previously using ilog(8)
and ilog(16)
respectively, did show decreased performance based on the size of the integer input.
The v0.2.5 count_octal_digits
and count_hex_digits
are now implemented internally using ilog2
, and now share that consistent, improved performance across the board.
Adds
- Adds links to benchmarks to documentation, hosted via GitHub Pages.
- Adds CHANGELOG.md (that's me) to the project.
Changes
- Reworks testing macros to make the test output more granular.
- Reworks the benchmark test boundaries to test iterations for each hexadecimal digit added to an integer, from one to max, for each integer type.
Improves
- Removes unnecessary
checked_ilog
functions from the implementations of variousCountDigits
functions.
Changes
- Updates documentation.
Adds
- Adds benchmarks using Criterion.
- Adds unit tests for helper functions used throughout the test suite.
Changes
- Updates documentation.
Adds
- Adds CodeCov jobs to CI.
- Adds radix boundary tests for all integer types.
Changes
- Updates documentation.
- Refactors iteration tests.
Fixes
- Fixes an issue where the unsigned, non-zero integer iteration tests were calling the
CountDigits
functions for their corresponding primitive types, resulting in a gap of test coverage for these types.
Major Changes
- Adds new trait functions to
CountDigits
, listed below.
Adds
- Adds
CountDigits::count_bits()
. - Adds
CountDigits::count_octal_digits()
. - Adds
CountDigits::count_hex_digits()
. - Adds
CountDigits::count_digits_radix()
. - Implements the above functions for signed, primitive integer types.
- Implements the above functions for signed, non-zero integer types.
- Implements the above functions for unsigned, primitive integer types.
- Implements the above functions for unsigned, non-zero integer types.
- Bumps the minimum supported Rust version
(1.67.1 -> 1.71.1)
due to usingis_negative()
for non-zero integer types.
Minor Changes
- Refactors iteration tests.
- Refactors min_and_max tests.
Initial Release
Adds
- Adds README.md.
- Adds Cargo.toml.
- Adds
CountDigits
trait. - Adds
CountDigits::count_digits()
function. - Implements
CountDigits
for signed, primitive integer types. - Implements
CountDigits
for signed, non-zero integer types. - Implements
CountDigits
for unsigned, primitive integer types. - Implements
CountDigits
for unsigned, non-zero integer types. - Adds tests for min and max values.
- Adds iterative tests for unsigned types.
- Adds iterative tests for signed types.
- Adds rust.yml to run tests in CI via GitHub Actions.