Releases: isaacholt100/bnum
v0.11.0
This release fixes #39, and makes all ilog*
methods panic with the same message as Rust's primitive integers (with the (bnum)
prefix, as for other bnum panic messages).
Major Changes
ilog*
methods now panic for invalid inputs in release mode as well as debug mode.
Patches
ilog*
panic messages now match that of Rust's primitives.
What's Changed
- Latest by @isaacholt100 in #40
Full Changelog: v0.10.0...v0.11.0
v0.8.1
v0.10.0
This release fixes #36, which was related to a premature stabilisation of the language feature const_intrinsic_copy
(see rust-lang/rust#117905). Previously, several functions had relied on this feature, which meant their implementations contained Undefined Behaviour. (For a list of those affected and for further details, see changes/prior-bugs.md
). Completely safe implementations have now been written for these functions.
This is marked as a major change as previous versions v0.7.0
- v0.9.1
may at some point cease to be compatible with the latest version of the Rust compiler, if stabilisation of const_intrinsic_copy
is reverted.
What's Changed
- v0.10.0 by @isaacholt100 in #38
Full Changelog: v0.9.1...v0.10.0
v0.9.1
Patches
The only change in this version is the addition of the rust-version
(MSRV) field to Cargo.toml
. The MSRV is currently 1.65.0
.
What's Changed
- Add minimum rust version by @chipshort in #34
- v0.9.1 by @isaacholt100 in #35
New Contributors
- @chipshort made their first contribution in #34
Full Changelog: v0.9.0...v0.9.1
v0.9.0
Changes in v0.9.0
Major Changes
bnum
integers are now#[repr(transparent)]
, which solves #30.- The
Slice
struct is now#[repr(transparent)]
. - The bnum
wrapping_rem
method now has the same panic message aswrapping_rem
on primitive integers. unchecked_shl
andunchecked_shr
now take au32
as the shifting argument instead ofSelf
.- The implementations of
unchecked_shl
andunchecked_shr
forbnum
integers with64
-bit digits were previously incorrect; they have now been fixed. - The implementation of
Add<$Digit>
on allbnum
unsigned integers was previously incorrect; it has now been fixed. - The
lcm
method onbnum
integers no longer panics ifself
is zero; instead, it returns zero.
Minor Changes
- Added optional
zeroize
support. - Added optional
quickcheck
support. - Added optional
valuable
support. - Change from manual implementation of
PartialEq
andEq
to#[derive(PartialEq, Eq)]
: this fixes #32. - Added trait
BTryFrom
for fallible conversions between bnum integers - this is a temporary solution to #31. - Don't require the
std_rng
andsmall_rng
features of therand
crate except when testing.
Patches
- Improved performance for all
shr
methods (checked_shr
,wrapping_shr
, etc.).
Auto release notes
- v0.9.0 by @isaacholt100 in #33
Full Changelog: v0.8.0...v0.9.0
v0.8.0
Breaking Changes
There are no breaking changes in this release.
Other Changes
- The following methods on all unsigned and signed integers are now
const
on stable:checked_div
,checked_div_euclid
,checked_rem
,checked_rem_euclid
,checked_next_multiple_of
,checked_ilog10
,checked_ilog
,div
,rem
,overflowing_div
,overflowing_div_euclid
,overflowing_rem
,overflowing_rem_euclid
,saturating_div
,wrapping_div
,wrapping_div_euclid
,wrapping_rem
,wrapping_rem_euclid
,div_euclid
,rem_euclid
,ilog10
,ilog
,next_multiple_of
,div_floor
,div_ceil
. - It is now possible to cast between bnum integers of different digit sizes: for example, you can cast to and from
BUint<5>
toBIntD16<7>
. - Issue #25 has been fixed, which means that all formatting trait implementations should now match those for primitive integers (in previous versions, some formatting traits ignored formatting options such as zero padding).
What's Changed
- v0.8.0 by @isaacholt100 in #28
- Fix error in publish.yml by @isaacholt100 in #29
Full Changelog: v0.7.0...v0.8.0
v0.7.0
Breaking changes
- Unfortunately version
1.71.0
of the nightly Rust compiler dropped support of theconst
implementation of common standard library traits. Previous to this version,bnum
hadconst
implementations of many standard library traits such asAdd
,BitOr
,PartialEq
, etc. which were available using nightly. However, now this is no longer possible with the current version of the nightly Rust compiler (as of 28th May 2023), hence theconst
implementations of these traits have been dropped for now to allow compatibility with the latest version on nightly. To account for this, many of the methods defined on these traits now haveconst
implementations on the integer types themselves - so for example, there are nowBUint::shr
andBInt::shr
methods which areconst
.
Other changes
- The (non-default)
arbitrary
feature has been introduced, which derives theArbitrary
trait from thearbitrary
crate. Note that normallybnum
works withno_std
, but it cannot with this feature enabled. - The following methods are now
const
on stable:abs_diff
,<uint>::{overflowing_neg, wrapping_neg}
,wrapping_{shr, shl}
,overflowing_{shr, shl}
,checked_{shr, shl}
,rotate_left
,rotate_right
,from_be_slice
,from_le_slice
.
(@lrubasze contributed the addition of the arbitrary
support in this release - due to a complication with the CI with his pull request, I'm mentioning him here so he is included in this list of contributors).
What's Changed
- Add support for const-trait methods defined on the types themselves by @isaacholt100 in #21
- Bump version to 0.7.0 by @isaacholt100 in #24
Full Changelog: v0.6.0...v0.7.0
v0.6.0
There were no breaking changes in this release. The biggest update is the introduction of the const parse_str_radix
method on signed and unsigned integers, which allows compile-time parsing of string literals in a given radix. from_str_radix
is now also const, which allows compile-time parsing of string literals which are not guaranteed to parse successfully.
The following methods are now const
on stable:
{BUint, BInt}::parse_bytes
BInt::overflowing_mul
BInt::overflowing_neg
BInt::overflowing_abs
BInt::overflowing_pow
BInt::wrapping_neg
BInt::wrapping_abs
BInt::checked_mul
BInt::checked_neg
BInt::checked_abs
BInt::checked_pow
BInt::saturating_mul
BInt::saturating_neg
BInt::saturating_abs
BInt::saturating_pow
BInt::unsigned_abs
BInt::pow
BInt::abs
BInt::abs_diff
Additionally, the following methods are now const
when the nightly
feature is enabled:
{BUint, BInt}::from_radix_be
{BUint, BInt}::from_radix_le
What's Changed
- v0.6.0 by @isaacholt100 in #19
Full Changelog: v0.5.0...v0.6.0
v0.5.0
Another minor release, the only breaking change in this release is that the implementations of traits from the num_traits
and num_integer
traits are no longer const
, since those traits are not marked as const_trait
in those crates.
Previously, traits defined in the crate were not marked as const_trait
which meant that they couldn't be used in the latest version of Rust nightly (currently 1.68.0). Now this issue has been fixed and the latest version of nightly can be used.
What's Changed
- Upgrade to v0.5.0 by @isaacholt100 in #12
- Merge pull request #12 from isaacholt100/float_arithmetic by @isaacholt100 in #13
- Update rust.yml by @isaacholt100 in #14
Full Changelog: v0.4.0...v0.5.0
v0.4.0
No changes to functionality were made in this release, the only changes were editing the metadata of the project's optional dependencies so that they had default-features = false
in Cargo.toml
, which allows for bnum
to be used in no_std
environments while still enabling these optional dependencies.
NB: docs.rs failed to build the documentation for this release, due to a compile error (since this version didn't work with the current latest version of nightly, 1.68.0 at the time of writing).
NB: this release and earlier releases don't work with the current latest version of nightly, 1.68.0 (and, most likely, future versions) because it contains const
implementations of crates which are not marked as const_trait
. Upgrade to the latest version (currently v0.5.0) to be able to use the latest version of nightly.
What's Changed
New Contributors
Full Changelog: v0.3.0...v0.4.0