Skip to content

Releases: isaacholt100/bnum

v0.11.0

06 Mar 21:37
d715a3e
Compare
Choose a tag to compare

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

Full Changelog: v0.10.0...v0.11.0

v0.8.1

24 Nov 10:01
Compare
Choose a tag to compare

This release fixes #36. For more info, see the release notes for v0.10.0.

v0.10.0

23 Nov 22:19
f1520e5
Compare
Choose a tag to compare

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

Full Changelog: v0.9.1...v0.10.0

v0.9.1

25 Oct 18:06
6e26ddb
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v0.9.0...v0.9.1

v0.9.0

28 Sep 15:14
ab5cb86
Compare
Choose a tag to compare

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 as wrapping_rem on primitive integers.
  • unchecked_shl and unchecked_shr now take a u32 as the shifting argument instead of Self.
  • The implementations of unchecked_shl and unchecked_shr for bnum integers with 64-bit digits were previously incorrect; they have now been fixed.
  • The implementation of Add<$Digit> on all bnum unsigned integers was previously incorrect; it has now been fixed.
  • The lcm method on bnum integers no longer panics if self 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 and Eq 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 and small_rng features of the rand crate except when testing.

Patches

Auto release notes

Full Changelog: v0.8.0...v0.9.0

v0.8.0

23 Jul 18:52
fdff946
Compare
Choose a tag to compare

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> to BIntD16<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

Full Changelog: v0.7.0...v0.8.0

v0.7.0

28 May 17:02
9f4a08f
Compare
Choose a tag to compare

Breaking changes

  • Unfortunately version 1.71.0 of the nightly Rust compiler dropped support of the const implementation of common standard library traits. Previous to this version, bnum had const implementations of many standard library traits such as Add, 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 the const 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 have const implementations on the integer types themselves - so for example, there are now BUint::shr and BInt::shr methods which are const.

Other changes

  • The (non-default) arbitrary feature has been introduced, which derives the Arbitrary trait from the arbitrary crate. Note that normally bnum works with no_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

Full Changelog: v0.6.0...v0.7.0

v0.6.0

07 Mar 14:08
cb9df63
Compare
Choose a tag to compare

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

Full Changelog: v0.5.0...v0.6.0

v0.5.0

02 Jan 17:45
9ad9377
Compare
Choose a tag to compare

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

Full Changelog: v0.4.0...v0.5.0

v0.4.0

24 Dec 20:32
Compare
Choose a tag to compare

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

  • disable default features for num-traits and num-integer by @lrubasze in #11

New Contributors

Full Changelog: v0.3.0...v0.4.0