Ratio::approximate_float_unsigned
to convert FloatCore
types to unsignedconst ZERO
and ONE
, and implement num_traits::ConstZero
and ConstOne
Ratio::into_raw
to deconstruct the numerator and denominatorContributors: @cuviper, @Enyium, @flavioroth, @waywardmonkeys
clone
calls are used when reducing a new Ratio<T>
.Ratio<T>
now implements Default
, returning a zero value.Contributors: @cuviper, @lemmih, @MattX
num-bigint
dependency is now 0.4.Rational
alias for Ratio<usize>
is now deprecated. It is recommended to use specific type sizes for numeric computation, like Rational32
and Rational64
.Contributors: @cuviper, @vks
Contributors: @Nemo157
Contributors: @cuviper, @zetok
Ratio
now implements ToPrimitive
.Ratio
now implements additional formatting traits:Binary
, Octal
, LowerHex
, UpperHex
, LowerExp
, UpperExp
Pow
implementations have been expanded.Pow<BigInt>
and Pow<BigUint>
are now implemented.Pow<_> for &Ratio<T>
now uses &T: Pow
.pow
method now uses &T: Pow
.num-rational
now requires Rust 1.31 or greater.std
enabled.std
uses alloc
on Rust 1.36+.Contributors: @cuviper, @MattX, @maxbla
Ratio
now performs earlier reductions to avoid overflow with +-*/%
operators.Ratio::{new_raw, numer, denom}
are now const fn
for Rust 1.31 and later.autocfg
build dependency to 1.0.Contributors: @cuviper, @dingelish, @jimbo1qaz, @maxbla
Contributors: @cuviper, @ignatenkobrain, @vks
html_root_url
.Ratio
now implements One::is_one
and the Inv
trait.Ratio
now implements Sum
and Product
.Ratio
now supports i128
and u128
components with Rust 1.26+.Ratio
now implements the Pow
trait.num-rational
now requires rustc 1.15 or greater.std
feature, enabled by default, along with the implication that building without this feature makes this a #![no_std]
crate. A few methods now require FloatCore
instead of Float
.serde
dependency has been updated to 1.0, and rustc-serialize
is no longer supported by num-rational
.num-bigint
dependency has been updated to 0.2, and should be enabled using the bigint-std
feature. In the future, it may be possible to use the bigint
feature with no_std
.Contributors: @clarcharr, @cuviper, @Emerentius, @robomancer-or, @vks
Ratio
now implements CheckedAdd
, CheckedSub
, CheckedMul
, and CheckedDiv
.Ratio
now implements AddAssign
, SubAssign
, MulAssign
, DivAssign
, and RemAssign
with either Ratio
or an integer on the right side. The non-assignment operators now also accept integers as an operand.Ratio
operators now make fewer clone()
calls.Thanks to @c410-f3r, @cuviper, and @psimonyi for their contributions!
No prior release notes were kept. Thanks all the same to the many contributors that have made this crate what it is!