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!