rug
Arbitrary-precision integers, rational, floating-point and complex numbers based on GMP, MPFR and MPC.
1.30.0
5.4M downloads/mo
#4366 most downloaded on crates.io
source
What this package is like to depend on
Last release 3 months ago
27 Apr 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 55 of 58 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
58 releases · first in 2017
3 releases in the last 12 months
see the full history below
Release timeline
58 releases · Jun 2017 to Apr 2026Releases
latest 58-
1.30.027 Apr 2026Release notes
Open source →- Arithmetic operators are now overloaded to work between:
IntegerandMiniIntegerRationalandMiniRationalFloatandMiniFloatComplexandMiniComplex- The following method was added to
MiniRational:
- Arithmetic operators are now overloaded to work between:
-
1.29.020 Mar 2026Release notes
Open source →- The [az crate] dependency was updated to version 1.3.
- The [gmp-mpfr-sys] dependency was updated to version 1.7.
- The following methods were added to
Complex:
- The [az crate] dependency was updated to version 1.3.
-
1.28.121 Jan 2026Release notes
Open source → -
1.28.021 Aug 2025Release notes
Open source →- The crate now requires rustc version 1.85.0 or later.
- The following methods were added to
Float: - The following methods were added to
Complex: - The experimental feature
num-complexwas added (issue 84). - The experimental feature
borshwas added (merge request 6).
- The following methods were added to
- The crate now requires rustc version 1.85.0 or later.
-
1.27.024 Jan 2025Release notes
Open source →- The [az crate], which is a dependency, is now re-exported (issue 73).
Compatibility note
-
1.26.111 Sep 2024Release notes
Open source →- Bug fix: implementations of
CompleteRoundwere wrongly usingprec_tinstead of [u32] for <code>CompleteRound::Prec</code> (issue 72).
- Bug fix: implementations of
-
1.26.030 Aug 2024Release notes
Open source →- Bug fix:
Completewas not implemented but documented for incomplete values produced by the following methods (issue 69): * <code>Integer::clamp_ref</code>, <code>Integer::invert_ref</code>, <code>Integer::pow_mod_ref</code> * <code>Integer::random_bits</code>, <code>Integer::random_below_ref</code>- <code>Float::get_significand</code> is now usable in const context.
- The experimental feature
nightly-floatwas added (issue 68).
- Bug fix:
-
1.25.111 Sep 2024Release notes
Open source →- Bug fix: implementations of
CompleteRoundwere wrongly usingprec_tinstead of [u32] for <code>CompleteRound::Prec</code> (issue 72).
- Bug fix: implementations of
-
1.25.018 Jul 2024Release notes
Open source →- The following functions were added:
- <code>float::prec_min_64</code>, <code>float::prec_max_64</code>
- The <code>complex::Prec64</code> trait was added.
- The following methods were added:
- <code>Float::new_64</code>, <code>Float::with_val_64</code>, <code>Float::with_val_round_64</code>
- <code>Float::prec_64</code>, <code>Float::set_prec_64</code>, <code>Float::set_prec_round_64</code>
- <code>Complex::new_64</code>, <code>Complex::with_val_64</code>, <code>Complex::with_val_round_64</code>
- <code>Complex::prec_64</code>, <code>Complex::set_prec_64</code>, <code>Complex::set_prec_round_64</code>
- The following functions were added:
-
1.24.131 Mar 2024Release notes
Open source →- Bug fix: a precondition for
slice::from_raw_partswas being violated (issue 63).
- Bug fix: a precondition for
-
1.24.025 Jan 2024Release notes
Open source →Floatnow implements <code>AssignRound<[bool][bool]></code>.- The following methods are now usable in const context:
- The
stdoptional feature was added (issue 62). The feature is enabled by default, and the crate will be compiled without the standard library (no_std) if the feature is disabled. MiniRationalnow implements- <code>[From][
From]<MiniInteger></code>, <code>Assign<MiniInteger></code>
- <code>[From][
MiniFloatnow implements- <code>[From][
From]<[bool][bool]></code>, <code>Assign<[bool][bool]></code>
- <code>[From][
MiniComplexnow implements- The following methods were added to
MiniInteger: - The following method was added to
MiniRational: - The following methods were added to
MiniFloat: - The following methods were added to
MiniComplex: - When the
num-traitsexperimental feature is enabled, the following traits are implemented forInteger:
Compatibility notes
- The following methods no longer set the MPFR NaN flag if a NaN is encountered:
- Functionality that depends on
stdnow requires thestdfeature to be enabled. While thestdfeature is enabled by default, it is now disabled if the crate’s default features are disabled in [Cargo.toml]. In this case,stdmust be added to the list of features to reenable the functionality. - The implementation of the deprecated
SmallInteger,SmallRational,SmallFloatandSmallComplexwas changed to remove [their soundness issue][issue 52]. They now allocate memory for the digits, though their whole point was to be non-allocating.
-
1.23.018 Jan 2024Release notes
Open source →MiniInteger,MiniRational,MiniFloatandMiniComplexwere added to replaceSmallInteger,SmallRational,SmallFloatandSmallComplex, which are now deprecated. * The new structs do not implement [Deref] directly, as this causes issues with the current Rust memory models (issue 52). * Borrowing requires the use of theborrowmethods, which return an object that implements [Deref]. * The newborrow_exclmethods were also added; they require exclusive access in order to save on some housekeeping and to return references directly without the need of [Deref]. * The new structs implement [Copy] and [Sync].
-
1.22.011 Sep 2023Release notes
Open source →- Bug fix: implementations of [
PartialOrd] and [PartialEq] betweenRationalnumbers and tuples of two primitive integers were breaking the transitivity property of the traits, so the implementations were removed (issue 58). See the compatibility note below.- Direct [
PartialOrd] and [PartialEq] comparisons are now implemented- between
IntegerandSmallInteger, - between
RationalandSmallRational, and - between
FloatandSmallFloat.
- between
- Direct [
PartialEq] comparisons are now implemented betweenComplexandSmallComplex. SmallIntegercan now be assigned or converted directly toIntegerusingAssignand [From].SmallRationalcan now be assigned or converted directly toRationalusingAssignand [From].SmallFloatcan now be assigned directly toFloatusingAssignRoundandAssign.SmallComplexcan now be assigned directly toComplexusingAssignRoundandAssign.- [
Debug] is now implemented forSmallInteger,SmallRational,SmallFloatandSmallComplex. - For the
Complexstruct, the methodeq0was renamed tois_zero. The old method name is deprecated.
- Direct [
Compatibility note
The implementations of [
PartialOrd] and [PartialEq] betweenRationalnumbers and tuples of two primitive integers were breaking the transitivity property of the two traits in question. Since the implementations necessarily break the trait guarantees, having the traits implemented is considered a bug (see issue 58 for more details). These buggy implementations were removed. To fix code that used these comparisons without adding extra allocations,SmallRationalcan be used. For examplerational == (1, 3)can be replaced withrational == SmallRational::from((1, 3)). - Bug fix: implementations of [
-
1.21.028 Aug 2023Release notes
Open source →- The following methods were added to
Integer: *is_zero,is_positive,is_negative*modulo,modulo_mut,modulo_from,modulo_ref- The following methods were added to
Rational: - Bug fix: panic instead of raising floating-point exception when dividing by
Rationalzero (issue 53). Completewas implemented for incomplete values produced byDivRoundingandRemRoundingimplementations (merge request 4).
- The following methods were added to
- The following methods were added to
-
1.20.103 Aug 2023Release notes
Open source →- Bug fix: <code>[Float][flo-1-20]::[to_f32_round][flo-tfr-1-20]</code> was rounding some numbers in the subnormal range incorrectly ([issue 56]).
-
1.20.031 Jul 2023Release notes
Open source →- The [gmp-mpfr-sys] dependency was updated to version 1.6.
-
1.19.223 Mar 2023Release notes
Open source →- Bug fix: a zero denominator could be left after catching a panic from <code>[Rational][rat-1-19]::[mutate_numer_denom][rat-mnd-1-19]</code> ([issue 49]).
-
1.19.114 Feb 2023Release notes
Open source →- Bug fix: <code>[Rational][rat-1-19]::[mutate_numer_denom][rat-mnd-1-19]</code> and <code>[Complex][com-1-19]::[mutate_real_imag][com-mri-1-19]</code> were not unwind-safe ([issue 47]).
-
1.19.006 Jan 2023Release notes
Open source →- The crate now requires rustc version 1.65.0 or later.
- The [gmp-mpfr-sys] dependency was updated to version 1.5.
- The <code>Round::AwayZero</code> rounding mode was added.
- The following methods were added to
Float:sin_u,sin_u_mut,sin_u_round,sin_u_refcos_u,cos_u_mut,cos_u_round,cos_u_reftan_u,tan_u_mut,tan_u_round,tan_u_refsin_pi,sin_pi_mut,sin_pi_round,sin_pi_refcos_pi,cos_pi_mut,cos_pi_round,cos_pi_reftan_pi,tan_pi_mut,tan_pi_round,tan_pi_refasin_u,asin_u_mut,asin_u_round,asin_u_refacos_u,acos_u_mut,acos_u_round,acos_u_refatan_u,atan_u_mut,atan_u_round,atan_u_refatan2_u,atan2_u_mut,atan2_u_round,atan2_u_refasin_pi,asin_pi_mut,asin_pi_round,asin_pi_refacos_pi,acos_pi_mut,acos_pi_round,acos_pi_refatan_pi,atan_pi_mut,atan_pi_round,atan_pi_refatan2_pi,atan2_pi_mut,atan2_pi_round,atan2_pi_reflog2_1p,log2_1p_mut,log2_1p_round,log2_1p_reflog10_1p,log10_1p_mut,log10_1p_round,log10_1p_refexp2_m1,exp2_m1_mut,exp2_m1_round,exp2_m1_refexp10_m1,exp10_m1_mut,exp10_m1_round,exp10_m1_refcompound_i,compound_i_mut,compound_i_round,compound_i_refroot_i,root_i_mut,root_i_round,root_i_ref
- The following methods were added to
Complex: - The following methods are now const functions:
- <code>Integer::as_limbs</code>
- <code>Integer::as_neg</code>, <code>Integer::as_abs</code>
- <code>Integer::is_even</code>, <code>Integer::is_odd</code>
- <code>Integer::cmp0</code>
- <code>Rational::into_raw</code>, <code>Rational::as_raw</code>
- <code>Rational::numer</code>, <code>Rational::denom</code>
- <code>Rational::into_numer_denom</code>
- <code>Rational::as_neg</code>, <code>Rational::as_abs</code>, <code>Rational::as_recip</code>
- <code>Rational::cmp0</code>
- <code>Rational::is_integer</code>
- <code>Float::prec</code>
- <code>Float::from_raw</code>, <code>Float::into_raw</code>, <code>Float::as_raw</code>
- <code>Float::as_ord</code>, <code>Float::as_complex</code>
- <code>Float::is_nan</code>, <code>Float::is_infinite</code>, <code>Float::is_finite</code>, <code>Float::is_zero</code>, <code>Float::is_normal</code>, <code>Float::classify</code>
- <code>Float::cmp0</code>
- <code>Float::get_exp</code>
- <code>Float::is_sign_positive</code>, <code>Float::is_sign_negative</code>
- <code>Complex::prec</code>
- <code>Complex::from_raw</code>, <code>Complex::into_raw</code>, <code>Complex::as_raw</code>
- <code>Complex::real</code>, <code>Complex::imag</code>
- <code>Complex::into_real_imag</code>, <code>Complex::borrow_real_imag</code>
- <code>Complex::as_ord</code>
- <code>Complex::eq0</code>
BorrowInteger,BorrowRational,BorrowFloatandBorrowComplexnow implement [Clone], [Copy] and formatting traits; and each have a static methodconst_deref.
- The crate now requires rustc version 1.65.0 or later.
-
1.18.017 Nov 2022Release notes
Open source →- For the
Integerstruct, the methodsgcd_cofactors,gcd_cofactors_mutandgcd_cofactors_refwere renamed toextended_gcd,extended_gcd_mutandextended_gcd_ref. The old method names are deprecated.- All error types now implement [
Clone], [Copy], [PartialEq] and [Eq]. - The
IntegerExt64extension trait was added to support very large integers better on some 64-bit platforms.
- All error types now implement [
- For the
-
1.17.006 Aug 2022Release notes
Open source →- The new method
<code>Integer::assign_bytes_radix_unchecked</code>
was added (issue 41).
Integernow implements [LowerExp] and [UpperExp] for convenience by transparently converting theIntegerto aFloat(issue 42).- Bug fix: the
CompleteRoundtrait is now implemented for- the value returned from <code>Float::mul_add_mul_ref</code>
- the value returned from <code>Float::mul_sub_mul_ref</code>
- The
CompleteRoundtrait is now also implemented for
- The new method
<code>Integer::assign_bytes_radix_unchecked</code>
was added (issue 41).
-
1.16.028 Apr 2022Release notes
Open source →- Now
FloatimplementsCast,CheckedCastandUnwrappedCastwith primitive integers as the destination types, in addition to the previously supportedSaturatingCast.- The new methods <code>Float::total_cmp</code> and <code>Complex::total_cmp</code> were added.
- The new methods <code>Complex::borrow_real_imag</code> and <code>Complex::mutate_real_imag</code> were added.
- Arithmetic operators are overloaded to work on combinations of Rug types and
[
isize] and [usize]. - The
BorrowInteger,BorrowRational,BorrowFloatandBorrowComplexstructs were added.
- Now
-
1.15.003 Feb 2022Release notes
Open source →- Now
Integer,Rational,FloatandCompleximplement [Shl], [Shr], [ShlAssign] and [ShrAssign] with [isize] and [usize] as the type of the right-hand side, in addition to the previously supported [i32] and [u32].- The new experimental feature
num-traitswas added to implement some traits from the [num-traits crate] and the [num-integer crate] (issue 30).
- The new experimental feature
- Now
-
1.14.123 Jan 2022Release notes
Open source →- Bug fix: <code>[Rational][rat-1-14]::[to_f32][rat-tf-1-14]</code> was rounding away from zero in some cases when the rational number should be converted to a subnormal number ([issue 36]).
-
1.14.024 Nov 2021Release notes
Open source →- Bug fix:
OrdFloatwas incorrectly ordering +NaN < −∞.- The <code>Integer::ZERO</code> associated constant was added.
- The <code>Integer::shrink_to</code> method was added.
- The <code>Rational::is_integer</code> method was added.
- The <code>Complete::complete_into</code>
provided method was added to the
Completetrait. - The
CompleteRoundtrait was added to make it easier to convertFloatandComplexnumbers incomplete-computation values to their final value.
- Bug fix:
-
1.13.029 Jul 2021Release notes
Open source →- The incomplete-computation value returned by
<code>Integer::{sum,dot}</code> can
now be subtracted from an
Integer.- The incomplete-computation value returned by
<code>Rational::{sum,dot}</code> can
now be subtracted from a
Rationalnumber. - The incomplete-computation value returned by
<code>Float::{sum,dot}</code> can
now be subtracted from a
Float. - The incomplete-computation value returned by
<code>Complex::{sum,dot}</code> can
now be subtracted from a
Complexnumber. - The incomplete-computation value returned by
<code>Integer::square_ref</code> can now be
added to/subtracted from an
Integer. - The
Completetrait was added to make it easier to convert incomplete-computation values to their final value. - The <code>Round::reverse</code> method was added.
- The incomplete-computation value returned by
<code>Rational::{sum,dot}</code> can
now be subtracted from a
- The incomplete-computation value returned by
<code>Integer::{sum,dot}</code> can
now be subtracted from an
-
1.12.025 Mar 2021Release notes
Open source →- A new method <code>Integer::as_limbs</code> was
added.
- The [az crate] dependency was updated to version 1.1.
- A new method <code>Integer::as_limbs</code> was
added.
-
1.11.003 Sep 2020Release notes
Open source →- The [gmp-mpfr-sys] dependency was updated to version 1.4.
- Now it is possible to display
Floatnumbers with only one siginificant digit.
- Now it is possible to display
- The [gmp-mpfr-sys] dependency was updated to version 1.4.
-
1.10.023 Jul 2020 -
1.9.001 Jun 2020Release notes
Open source →- Displaying
FloatandComplexnumbers, and converting them to strings, now avoids outputting an exponent term if the radix point can be moved to the correct place without inserting any extra digits. For example"42.0"will be produced rather than"4.20e1"(issue 18). This change does not affect output when [LowerExp] ("{:e}"format) or [UpperExp] ("{:E}"format) is used.- New methods <code>Float::to_sign_string_exp</code> and <code>Float::to_sign_string_exp_round</code> were added.
- A new function <code>float::allowed_exp_range</code> was added.
- A new method <code>Float::clamp_exp</code> was added.
- The following methods are now const functions:
- The [az crate] is now a public dependency, and wrapping and checked casts to/from primitives and big numbers are provided through the traits of the crate.
Compatibility note
The output of
FloatandComplexnumbers was changed as specified above. - Displaying
-
1.8.008 Apr 2020Release notes
Open source →- The following methods are now const functions:
* <code>Integer::new</code>,
<code>Integer::into_raw</code>,
<code>Integer::as_raw</code>
* <code>SmallInteger::new</code>,
<code>SmallRational::new</code>
- A new method <code>Integer::as_rational</code> was added.
- A new method <code>Float::as_complex</code> was added.
SmallFloatandSmallComplexcan now be initialized withSpecial.- New methods <code>SmallFloat::new</code> and <code>SmallComplex::new</code> were added.
SmallFloatandSmallComplexnow implement [Default].Integernow implements <code>[AsRef][AsRef]<[[][slice]limb_t[]][slice]></code>.Floatnow implements <code>[AsRef][AsRef]<OrdFloat></code>, andOrdFloatnow implements <code>[AsRef][AsRef]<Float></code> and <code>[AsMut][AsMut]<Float></code>.Complexnow implements <code>[AsRef][AsRef]<OrdComplex></code>, andOrdComplexnow implements <code>[AsRef][AsRef]<Complex></code> and <code>[AsMut][AsMut]<Complex></code>.
- The following methods are now const functions:
* <code>Integer::new</code>,
<code>Integer::into_raw</code>,
<code>Integer::as_raw</code>
* <code>SmallInteger::new</code>,
<code>SmallRational::new</code>
-
1.7.021 Jan 2020Release notes
Open source →- The crate now requires rustc version 1.37.0 or later.
- The [gmp-mpfr-sys] dependency was updated to version 1.2.
- The
RemAssignRoundandRemFromRoundtraits were added. - The [
Rem], [RemAssign],RemFrom,RemAssignRoundandRemFromRoundtraits were implemented forFloat. - Arithmetic operations with one
Integeror integer primitive operand and oneRationaloperand were added. - A new method <code>Integer::div_exact_from</code> was added.
- New methods <code>Integer::gcd_u</code>, <code>Integer::gcd_u_mut</code> and <code>Integer::gcd_u_ref</code>were added.
- New methods <code>Integer::lcm_u</code>, <code>Integer::lcm_u_mut</code> and <code>Integer::lcm_u_ref</code>were added.
- New methods <code>Float::remainder</code>, <code>Float::remainder_mut</code>, <code>Float::remainder_round</code>, <code>Float::remainder_from</code>, <code>Float::remainder_from_round</code> and <code>Float::remainder_ref</code> were added.
Compatibility note
SmallInteger,SmallRational,SmallFloatandSmallComplexare no longer [Sync] to avoid the possibility of a data race. References obtained by dereferencing them, for example the <code>&Integer</code> returned from <code>SmallInteger::[deref][deref]</code>, are still [Send] and [Sync].
- The crate now requires rustc version 1.37.0 or later.
-
1.6.003 Sep 2019Release notes
Open source →- Arithmetic operator implementations for [
i8], [i16], [i64], [i128], [u8], [u16], [u64] and [u128] were added to the existing implementations for [i32] and [u32].- A new function
<code>float::free_cache</code> and its
supporting enum
FreeCachewere added. - A new method <code>RandState::into_custom_boxed</code> was added.
- A new struct
ThreadRandStateand a new traitThreadRandGenwere added to therandmodule to enable the use of custom random generators that are not [Send] and [Sync]. - Numeric type methods which take
RandStatenow can also takeThreadRandState.
- A new function
<code>float::free_cache</code> and its
supporting enum
Compatibility note
- The numeric type methods which took <code>&mut RandState</code> were changed to take <code>&mut dyn MutRandState</code> instead. Under normal use, this does not have any affect apart from allowing the use of <code>&mut ThreadRandState</code> as well. With function inlining and optimization, the generated code should have the same performance.
- Arithmetic operator implementations for [
-
1.5.226 Jul 2019Release notes
Open source →- Bug fix: <code>[Pow][pow-1-5]<[i32][
i32]> for [Rational][rat-1-5]</code> was returning the reciprocal of the correct result.
- Bug fix: <code>[Pow][pow-1-5]<[i32][
-
1.5.110 Jul 2019Release notes
Open source →- Bug fix: a memory leak in conversions of [
Float][flo-1-5] to string was fixed (https://gitlab.com/tspiteri/rug/-/issues/11).
- Bug fix: a memory leak in conversions of [
-
1.5.004 Jul 2019Release notes
Open source →- A new method
<code>Integer::assign_digits_unaligned</code>
was added to enable reading digits from unaligned memory.
- A new method <code>Integer::write_digits_unaligned</code> was added to enable writing digits to unaligned and uninitialized memory.
- New methods <code>Float::u_exp</code> and <code>Float::i_exp</code> were added.
- A new method <code>Complex::abs_round</code> was added.
- The documentation examples on
from_rawmethods now use [MaybeUninit] instead of <code>[mem][mem]::[uninitialized][uninitialized]</code>.
- A new method
<code>Integer::assign_digits_unaligned</code>
was added to enable reading digits from unaligned memory.
-
1.4.024 Apr 2019Release notes
Open source →- The crate now requires rustc version 1.31.0 or later.
- The method <code>RandState::as_raw</code> was
fixed to take
&selfinstead of&mut self. - <code>[float][flom-1-0]::prec_min</code> and <code>[float][flom-1-0]::prec_max</code> are now const functions.
- New methods <code>Float::copysign</code>, <code>Float::copysign_mut</code> and <code>Float::copysign_ref</code> were added.
- The method <code>RandState::as_raw</code> was
fixed to take
- The crate now requires rustc version 1.31.0 or later.
-
1.3.026 Jan 2019 -
1.2.321 Jan 2019Release notes
Open source →- Fixed bug in <code>[Integer][int-1-2]::[assign_digits][int-ad-1-2]</code>. (Thanks: Eric Scrivner)
-
1.2.218 Oct 2018Release notes
Open source →- The [
NotAssign][noa-1-2], [BitAndFrom][baf-1-2], [BitOrFrom][bof-1-2] and [BitXorFrom][bxf-1-2] traits were implemented for [bool].- The [
NegAssign][nea-1-2] trait was implemented for [f32] and [f64].
- The [
- The [
-
1.2.116 Aug 2018Release notes
Open source →- The [
Integer][int-1-2] methods [from_digits][int-fd-1-2], [assign_digits][int-ad-1-2], [significant_digits][int-sd-1-2], [to_digits][int-td-1-2] and [write_digits][int-wd-1-2] now support [bool] [slices][slice].
- The [
-
1.2.030 Jun 2018Release notes
Open source →- The implementations of [
Sum] and [Product] forIntegerandRationalwere generalized to accept more types of elements.- New methods <code>Integer::keep_signed_bits</code>, <code>Integer::keep_signed_bits_mut</code> and <code>Integer::keep_signed_bits_ref</code> were added.
- New methods <code>Integer::sum</code>, <code>Integer::dot</code> and <code>Integer::product</code> were added
- New methods <code>Rational::sum</code>, <code>Rational::dot</code> and <code>Rational::product</code> were added.
- New methods <code>Float::dot</code> and <code>Complex::dot</code> were added.
- The implementations of [
-
1.1.119 May 2018 -
1.1.023 Apr 2018Release notes
Open source →- Support for [
i128] and [u128] conversions and comparisons was added, conditional on compiler support.- Conditional on compiler support, [
TryFrom] conversions were implemented for conversions - A new method <code>Float::get_significand</code> was added.
- New methods <code>Float::u_pow_u</code> and <code>Float::i_pow_u</code> were added.
- New methods <code>Integer::from_digits</code>, <code>Integer::to_digits</code>, <code>Integer::assign_digits</code>, <code>Integer::write_digits</code> and <code>Integer::significant_digits</code> were added, providing reading from and writing to slices of unsigned integer primitives.
- Conditional on compiler support, [
- Support for [
-
1.0.209 Apr 2018Release notes
Open source →- A bug in <code>[Integer][int-1-0]::[reserve][int-r-1-0]</code>, which was
shrinking the capacity in some cases, was fixed.
- The [gmp-mpfr-sys] dependency in [Cargo.toml] was fixed to use tilde instead of caret, since Rug uses internal implementation details.
- A bug in <code>[Integer][int-1-0]::[reserve][int-r-1-0]</code>, which was
shrinking the capacity in some cases, was fixed.
-
1.0.110 Mar 2018Release notes
Open source →- A new method
<code>[Integer][int-1-0]::[is_power_of_two][int-ipot-1-0]</code> was
added.
- A new method <code>[Integer][int-1-0]::[signed_bits][int-sb-1-0]</code> was added.
- New methods <code>[Integer][int-1-0]::[secure_pow_mod][int-spm-1-0]</code>, <code>[Integer][int-1-0]::[secure_pow_mod_mut][int-spmm-1-0]</code> and <code>[Integer][int-1-0]::[secure_pow_mod_ref][int-spmr-1-0]</code> were added.
- New methods <code>[Integer][int-1-0]::[div_rem_round][int-drr-1-0]</code>, <code>[Integer][int-1-0]::[div_rem_round_mut][int-drrm-1-0]</code> and <code>[Integer][int-1-0]::[div_rem_round_ref][int-drrr-1-0]</code> were added.
- A new method <code>[Complex][com-1-0]::[eq0][com-e-1-0]</code> was added.
- Documentation was improved.
- A new method
<code>[Integer][int-1-0]::[is_power_of_two][int-ipot-1-0]</code> was
added.
-
1.0.003 Mar 2018Release notes
Open source →- The methods <code>Integer::invert_mut</code> and
<code>Integer::pow_mod_mut</code> were changed
to return <code>[Result][
Result]<(), ()></code> instead of [bool].- The <code>float::Round</code>, <code>float::Constant</code> and <code>float::Special</code> enums are now marked as non-exhaustive.
- All deprecated items were removed.
- Unsound blanket implementations constrained on <code>T
where SmallInteger: Assign<T></code> inside
SmallRationaland on <code>T where SmallFloat: Assign<T></code> insideSmallComplexwere removed.
- The methods <code>Integer::invert_mut</code> and
<code>Integer::pow_mod_mut</code> were changed
to return <code>[Result][
-
0.10.017 Feb 2018Release notes
Open source →Integer::invert_refandInteger::pow_mod_refnow return anOption, not an object that is assignable toResult.Float::random_bitsandComplex::random_bitsare now assignable to the number values, not toResultobjects.Rational::signum,Rational::trunc,Rational::ceil,Rational::floorandRational::roundnow returnRational.Complex::abs,Complex::argandComplex::normnow returnComplex.- Remove
Defaultimplementations from all types ofFloatandComplex; now the precision always has to be specified. - Remove
SumandProductimplementations forFloatandComplex. - Remove
CloneandCopyimplementations from all incomplete computation types. - Revamp top-level crate documentation.
- Add
Integer::parseandRational::parse, and deprecateValidInteger,ValidRational,valid_str_radixmethods, andassign_str*methods. - Add
Float::parseandComplex::parse, and deprecateValidFloat,ValidComplex,from_str*methods,valid_str_radixmethods, andassign_str*methods. - Rename
Integer::gcd_coeffs*methods toInteger::gcd_cofactors*. Integer::gcd_cofactors_refnow supports computing only one cofactor.- Deprecate
Rational::to_integerandRational::as_numer_denom. - Deprecate
Rational::as_mut_numer_denomand replace withRational::mutate_numer_denom. - Deprecate
Complex::as_real_imag.
-
0.9.309 Feb 2018Release notes
Open source →- Add
Integer::squareandRational::squaremethods.- Add
Rational::cmp_absmethod. - Add
Float::sumandComplex::summethods. - Add
from_raw,into_raw,as_rawandas_raw_muttoRandState. - Add
RandGen::boxed_cloneandRandState::new_custom_boxed, and thus support for cloning custom random generators. - Fix
Float::PartialOrd<f32>(and<f64>) to returnNonewhen the primitive is NaN.
- Add
- Add
-
0.9.212 Jan 2018Release notes
Open source →- Require rustc version 1.18.0.
- Require gmp-mpfr-sys version 1.1.0.
- Deprecate most
assign_*methods, and replace with static methods that return an assignable object. - Deprecate
Rational::copy_to_integermethod. - Add
Rational::assign_canonicalandRational::from_canonicalmethods. - Add
Float::ln_umethod. - Add
Float::round_evenmethods. - Add
Float::gamma_incmethods. - Add
Float::random_normalandFloat::random_expmethods. - Deprecate
Float::assign_random_gaussianmethods. - Add
Complex::cmp_absmethod. - Add
Complex::root_of_unitymethod. - Deprecate
SmallRational::from_canonicalized_*methods and replace withSmallRational::from_canonicalmethod. - Deprecate
SmallRational::assign_canonicalized_*methods. - Add
as_nonreallocating_*methods toSmallInteger,SmallRational,SmallFloatandSmallComplex. - Fix
SmallFloat::newandSmallComplex::newto produce numbers with a precision of 53. - Deprecate and hide
float::Round::AwayFromZero. - Add
Integer::signum,Rational::signumandFloat::signummethods. - Add missing conversion to/from and comparisons to primitive types.
- Add
from_raw,into_raw,as_rawandas_raw_muttoInteger,Rational,FloatandComplex. - Add
Float::classifymethod. - Add
Float::mul_add,Float::mul_sub,Float::mul_add_mulandFloat::mul_sub_mulmethods. - Add
Complex::mul_addandComplex::mul_submethods.
- Require rustc version 1.18.0.
-
0.9.127 Nov 2017Release notes
Open source →- Implement mathematical operations where operands include references to
primitives.
- Remove undefined behaviour: replace
mem::swap(&mut src, &mut uninitialized)withptr::copy_nonoverlapping(&src, &mut uninitialized, 1).
- Remove undefined behaviour: replace
- Implement mathematical operations where operands include references to
primitives.
-
0.9.016 Nov 2017Release notes
Open source →- Move
rug::float::AssignRoundtorug::ops::AssignRound.OrdFloatnow orders +NaN above +∞, while −NaN is still below −∞.- Change
Float::subnormalizemethods to require explicit minimum normal exponent. - Add
Float::subnormalize_ieeemethods to deduce exponent range from precision, like oldFloat::subnormalize. The new method also supports all IEEE 754-2008 precisions corresponding to k storage bits where k ≥ 128 and k is a multiple of 32. - Deprecate
Rational::fractmethods and replace withRational::rem_truncmethods. - Add
Rational::rem_ceilandRational::rem_floormethods. - Add
Rational::rem_roundandRational::fract_roundmethods. - Add
Float::next_toward,Float::next_upandFloat::next_down. - Add optional serde support.
- Move
-
0.8.026 Oct 2017Release notes
Open source →- Rename
Integer::sign,Rational::signandFloat::signmethods asInteger::cmp0,Rational::cmp0andFloat::cmp0.- Rename
Float::pos_diffasFloat::positive_diff. - Move
rug::AssignRoundtorug::float::AssignRound. - Add
Integer::clamp,Rational::clampandFloat::clampmethods. - Add
Integer::div_rem_ceil,Integer::div_rem_floorandInteger::div_rem_eucmethods. - Add
DivRounding,DivRoundingAssignandDivRoundingFromtraits, and theirRemcounterparts, and implement them forInteger, and for combinations ofIntegerwithi32oru32. - Add
Rational::fract_floorandRational::fract_ceilmethods.
- Rename
- Rename
-
0.7.030 Sep 2017Release notes
Open source →- Fix swapped
Float::sin_cos_mutandFloat::sin_cos_round,Float::sinh_cosh_mutandFloat::sinh_cosh_round, andFloat::trunc_fract_mutandFloat::trunc_fract_round.- Fix
Float::to_f32_round. - Now
Float::subnormalizeonly works for precisions defined in IEEE 754. - Add
Integer::gcd_coeffsmethods.
- Fix
- Fix swapped
-
0.6.009 Aug 2017Release notes
Open source →- Requires rustc version 1.17.0.
- Rename
Float::abs_diffasFloat::pos_diff. - Replace
Float::get_signwithFloat::is_sign_positiveandFloat::is_sign_negative. - Add various
as_neg,as_absandas_conjmethods. - Add
OrdFloatandOrdComplexfor complete ordering.
- Rename
- Requires rustc version 1.17.0.
-
0.5.027 Jun 2017Nothing published for this version
-
0.4.020 Jun 2017Nothing published for this version
-
0.0.013 Jun 2017Nothing published for this version