[Rust] Lossless fractions and decimals; drop-in float replacement
APACHE-2.0 License
num
crate min required version is now 0.4.2
(The one where ConstOne and ConstZero were introduced)Published by dnsl48 6 months ago
Published by dnsl48 9 months ago
Published by dnsl48 10 months ago
sub_assign
and checked_sub
that could sometimes produce incorrect results for a couple of edge cases with a negative zero (-0
) as an operand.Published by dnsl48 about 1 year ago
approx
module with "Approximate mathematical operations", fn sqrt
(special thanks to @squ1dd13 for the contribution!)with-approx
feature, enabling the approx
modulePublished by dnsl48 over 1 year ago
Published by dnsl48 almost 2 years ago
PartialCmp
now compares NaN
with the other values and returns it as the smallest possible value. Thus, NaN < -Inf
.partial_cmp
now behaves exactly the same as cmp
(PartialOrd is now consistent with Ord).0.12.2
with the implementation of Ord
,Ord
would behave differently from PartialOrd
with NaN
values.Published by dnsl48 almost 2 years ago
Ord
trait implementation for GenericFraction and GenericDecimal (special thanks to Hsingai Tigris Altaica aka DrAlta)add
castable values (e.g. f + 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)sub
castable values (e.g. f - 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)div
castable values (e.g. f / 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)mul
castable values (e.g. f * 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)add_assign
castable values (e.g. f += 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)sub_assign
castable values (e.g. f -= 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)div_assign
castable values (e.g. f /= 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)mul_assign
castable values (e.g. f *= 1u8
, 1u8 will be transparently casted to Fraction
with .into()
)Published by dnsl48 about 2 years ago
See CHANGELOG.md for the details
Published by dnsl48 almost 4 years ago