Releases: dnsl48/fraction
Releases · dnsl48/fraction
0.15.3
0.15.2
[0.15.2] - 2024-04-28
Added
- GenericFraction ConstOne and ConstZero trait implementations (special thanks to Raimundo Saona, aka @saona-raimundo)
0.15.1
Added
- "with-unicode" feature implementation to format (and parse) floats with Unicode characters (special thanks to @feefladder)
0.15.0 / 2024-01-01
Added
- GenericFraction try_from/try_into implementations for primitive types (u8, i8, u16, i16, u32, i32, u64, i64, u128, i128, usize, isize, f32, f64)
- GenericFraction try_from/try_into implementations for BigInt/BigUint ("with-bigint" feature)
- GenericDecimal try_from/try_into implementations for primitive types (u8, i8, u16, i16, u32, i32, u64, i64, u128, i128, usize, isize, f32, f64)
- GenericDecimal try_from/try_into implementations for BigInt/BigUint ("with-bigint" feature)
- Tests for all GenericDecimal ops (overloadable operators - std::ops)
Changed
- GenericDecimal ops (overloadable operators) refactoring. Each operator is now implemented separately in its own module, allowing decoupled code with its own optimisations and tests.
Fixed
- PartialOrd will now reuse Ord implementation where possible (refactor to make clippy happier)
- Fixed logic in
sub_assign
andchecked_sub
that could sometimes produce incorrect results for a couple of edge cases with a negative zero (-0
) as an operand.
0.14.0
0.13.1
0.13.0
[0.13.0] - 2023-01-01
Changed
PartialCmp
now comparesNaN
with the other values and returns it as the smallest possible value. Thus,NaN < -Inf
.
Fixed
partial_cmp
now behaves exactly the same ascmp
(PartialOrd is now consistent with Ord).
This fixes an issue introduced in0.12.2
with the implementation ofOrd
,
whereOrd
would behave differently fromPartialOrd
withNaN
values.
Special thanks to Hsingai Tigris Altaica aka DrAlta for fixing this.
0.12.2
0.12.1
Added
- Support to
add
castable values (e.g.f + 1u8
, 1u8 will be transparently casted toFraction
with.into()
) - Support to
sub
castable values (e.g.f - 1u8
, 1u8 will be transparently casted toFraction
with.into()
) - Support to
div
castable values (e.g.f / 1u8
, 1u8 will be transparently casted toFraction
with.into()
) - Support to
mul
castable values (e.g.f * 1u8
, 1u8 will be transparently casted toFraction
with.into()
) - Support to
add_assign
castable values (e.g.f += 1u8
, 1u8 will be transparently casted toFraction
with.into()
) - Support to
sub_assign
castable values (e.g.f -= 1u8
, 1u8 will be transparently casted toFraction
with.into()
) - Support to
div_assign
castable values (e.g.f /= 1u8
, 1u8 will be transparently casted toFraction
with.into()
) - Support to
mul_assign
castable values (e.g.f *= 1u8
, 1u8 will be transparently casted toFraction
with.into()
)
Changed
- Refactoring of the fraction module. std::ops implementations moved into separate submodules.
- generic::read_generic_integer performance improved for when target type matches source (~83% improvement, which is 5 times faster).
As the result this can affect GenericFraction::from performance for non-float types. - From<(A, B)> implementation is migrated to GenericFraction::new_generic (~85% performance improvement and with no heap allocations, which is ~7 times faster).