Releases: mhogrefe/malachite
v0.5.0
v0.4.22
v0.4.21
v0.4.20
v0.4.19
This is a small release to address the following issues:
Also, I've made some changes to how the main malachite crate re-exports the sub-crate items. The items from malachite-base are now under a base
module, and the platform
module from malachite-nz, containing items like Limb
, is now exported.
v0.4.18
v0.4.17
I wasn't planning on releasing today, but after pishleback found a multiplication bug I wanted to push out a fix ASAP. I also released the partially-completed work that I've been doing on Malachite in the last few months.
- I rewrote a significant portion of malachite-float to exactly match the overflow and underflow behavior of MPFR. There are also explicit Float::MAX_EXPONENT and Float::MIN_EXPONENT constants now. This work is complete except for division of Floats by Floats, division of Floats by Rationals, division of Rationals by Floats, and multiplication of Floats by Rationals; I'll wrap that up soon. Note that all arithmetic operations worked perfectly well before this change, unless you were working with Floats whose absolute exponents are on the order of 1 billion.
- Malachite's integer multiplication code is translated from the corresponding code in FLINT. Since I first did that translation, Dan Schultz wrote a faster implementation for FLINT, and I've started working on incorporating a translation of that code into Malachite. It's not done yet, but it's already yielded one nice side benefit:
- Malachite now supports fast primality testing for primitive integers up to u64, also translated from FLINT's codebase; for example, after importing the
IsPrime
trait, you can write5509785649208481923u64.is_prime()
, which evaluates totrue
. I tested this function on hundreds of thousands of random u64s, and found that it completed in less than 1.5 milliseconds for every u64, whereas a naive approach based on trial division could take up to 1 second for a single u64. I will eventually implementIsPrime
for u128 andNatural
as well. - Converting primitive integers or primitive floats to
Float
now creates aFloat
with the minimum precision necessary to represent the original value. Previously, some less obvious precision choices were made. If you want some precision other than the default, you can always useFloat::from_unsigned_prec
,Float::from_unsigned_prec_round
, etc. - There are various other improvements. For example, I added an
AbsDiff
implementation forRational
.
v0.4.16
This release adds efficient Float
division, as well as efficient multiplication of Float
s by Rational
s, division of Float
s by Rational
s, and division of Rational
s by Float
s. Conversion from Rational
s to Float
s is also more efficient, because it now uses Float
division. The Reciprocal
trait, and related functions, are also now implemented for Float
s. Taking the reciprocal with these functions is slightly faster than computing 1/x using the division functions.
Now that the four basic arithmetic functions are supported for Float
s, I'm able to move on to more interesting functions. Apart from the square root function and efficient string conversion functions, the functions that have yet to be implemented have simpler implementations in MPFR than the functions that have already been translated for Malachite, so you can generally expect the development of Float
s to speed up a bit.
Other changes include
Float::from_natural_min_prec
and related functions, which convert fromNatural
s orInteger
s toFloat
s using the minimum precision necessary.Float::from_natural_prec_round_ref
is now smarter: if converting from a largeNatural
with low precision, only the few most-significant bits that are needed are copied.- More
Float
functions are now tested against therug
library. - Some more random
Natural
,Integer
, andRational
generators are added. - Two nontrivial
Float
constants are added (not actually constants, since you need to specify a precision and optionally a rounding mode). They are the prime constant and the Thue-Morse constant. They're not very useful; I just added them because I like constants. More useful constants are coming soon!
v0.4.15
This is a small release. Its purpose is mostly to include this pull request, which specifies the minimum supported Rust version. There is a more substantial release coming in the next weeks, which will contain efficient implementations of Float
division and reciprocation.
This release includes
- A MSRV specification, as mentioned above (thanks to John Vandenberg)
- Implementations of
AbsDiff
forInteger
- Implementations of
EqAbs
betweenRational
s and other numeric types - A small efficiency improvement for the
Sum
andProduct
implementations onRational
- More thorough testing for division-by-zero and exact rounding in
malachite-base
. This is purely proactive; no bugs have been found
v0.4.14
Added multiplication and squaring for Float
s. Implementations for multiplying a Float
by a Rational
were also added, but the implementations are naive; to use the same technique as MPFR we need Float
division, which Malachite can't do yet. But that's what I'll be working on next!