Skip to content

Releases: mhogrefe/malachite

v0.4.7

12 Apr 01:54
Compare
Choose a tag to compare

Added more copyright notices, including giving credit to individual authors of GMP, FLINT, and MPFR whenever their code was translated for inclusion into Malachite.

v0.4.6

04 Apr 17:19
Compare
Choose a tag to compare

Implemented Float addition and subtraction. The code is derived from MPFR and is highly optimized (which is one reason it took so long). The is functionality for providing a rounding mode, an output precision, or both. The defaults are RoundingMode::Nearest and the maximum precision of the inputs. There are also implementations for adding and subtracting a Float and a Rational; any numeric type apart from Rational can be losslessly converted to Float, so there are no implementations for e.g. Float + Natural, though in principle such an implementation could still be worthwhile since it would save some memory usage.

Next up: Float multiplication, squaring, and bit shifting (that is, multiplication and division by powers of 2).

v0.4.5

12 Feb 17:44
Compare
Choose a tag to compare

Various minor improvements.

  • Malachite is now no_std, unless the random, test_build, or bin_build features are enabled. Thanks to shekohex for initiating this work!
  • As suggested by amamic1803, a twos_complement_limb_count method has been added to Integer.
  • As pointed out by amamic1803, the malachite meta-crate did not have a 32_bit_limbs feature to propagate to its sub-crates. Now it does, along with a random feature.
  • I wrote a comment auto-formatter, eliminating the time I spend manually formatting comments. The newly-formatted comments account for most of the diff.
  • Integer now implements CheckedDiv. Natural now implements PartialOrdAbs for primitive floats. I added some tests for the AbsDiff trait in malachite-base in preparation for implementing it for Natural, Integer, and Rational.
  • The random Float generators were producing floats whose exponents were off by 1. That has been fixed.

Most of my work in the last few months has been implementing addition and subtraction for Floats. This is a lot less trivial than it sounds, because I'm translating MPFR's code, which is very optimized and has many special cases for addition and subtraction. Counterintuitively, implementing more advanced functions will take less time. I'm wrapping up the addition and subtraction work, so that will be released soon.

0.4.4

29 Oct 04:40
Compare
Choose a tag to compare

New release to fix incorrect dependencies.

v0.4.3

28 Oct 18:19
Compare
Choose a tag to compare
  • Fixed the multiplication bug described in #29.
  • Improved Natural (and by extension, Integer and Rational) parsing according to the suggestion in #27.
  • Added an optional random feature; see #26.
  • Modular arithmetic functions now panic when the inputs are not reduced. Previously, the documentation warned the user that reduced inputs are expected, but the behavior was unspecified when the inputs were not reduced.
  • CheckedDiv implemented for Natural. It was already implemented for Rational, and soon I'll add an Integer implementation as well.

v0.4.2

08 Oct 19:34
Compare
Choose a tag to compare

This release adds several const functions that can be used to initialize Naturals, Integers, and Rationals:

  • Natural::const_from_unsigned
  • Integer::const_from_unsigned
  • Integer::const_from_signed
  • Rational::const_from_unsigned
  • Rational::const_from_signed
  • Rational::const_from_unsigneds
  • Rational::const_from_signeds

The last two functions construct a Rational from a numerator and denominator. They use a const GCD function to reduce their arguments.

I'm continuing to work on a larger release that will include Float addition and subtraction, among other things.

v0.4.1

21 Sep 00:25
Compare
Choose a tag to compare

This is a small release to fix rustdocs for the malachite crate. Thanks to konstin for the fix.

Work for 0.4.2 is well underway. It will include addition and subtraction for Floats, and several ergonomic improvements to other parts of Malachite.

v0.4.0

03 Sep 01:40
Compare
Choose a tag to compare
  • I created the malachite-float crate and the Float type. Floats are currently very incomplete; hardly any arithmetic is implemented yet. However, there is a full complement of functions for comparison and conversion between between Floats and other numeric types. Those functions are extensively tested and documented. But note that the current functions for converting to and from strings are not stable; eventually I will implement them in a way that matches MPFR's behavior, but that requires division and logarithms, which are not yet implemented.
  • Most functions that take a RoundingMode now also return an Ordering indicating whether the rounded value is less than, greater than, or equal to the notional exact value. If you currently use these functions (for example, rounding_from or shr_round), you may need to append an .0 after the function call to extract the rounded value and ignore the Ordering.
  • We have some features from new contributors!
    • b4D8 implemented the One, Two, and NegativeOne traits for NonZero* types.
    • segfault87 implemented CheckedDiv for Rationals. In the next release I'll implement it for Naturals and Integers as well.
  • Malachite used to have an Iverson trait for the Iverson bracket, which converts booleans to numbers. I replaced this with From<bool> everywhere once I realized that it was already implemented for primitive integers.
  • Bugfixes:
    • LimbIterator behaved incorrectly (Issue 18). Although it was thoroughly tested like all of Malachite's features, I didn't realize what the correct behavior should have been when I originally wrote the tests. Thanks to qingshi163 for catching this.
    • Natural::from_string_base did not always fail when it should have (Issue 20). There was a small gap in the testing; from_string_base's behavior on valid strings was well-tested, but its behavior on invalid strings was not. Thanks to qingshi163 for catching this one as well.

v0.3.2

20 Jan 04:00
Compare
Choose a tag to compare

added/completed small prime generation, primorials, and binomial coefficients. As usual, the same algorithms are used as in GMP.

v0.3.1

22 Dec 01:45
Compare
Choose a tag to compare

This release is mostly to fix #6.

There has also been some work on small prime generation, primorials, and binomial coefficients, which I will complete in the next release.