Skip to content

0.12.1

Compare
Choose a tag to compare
@dnsl48 dnsl48 released this 18 Oct 07:40
· 73 commits to master since this release

Added

  • Support to add castable values (e.g. f + 1u8, 1u8 will be transparently casted to Fraction with .into())
  • Support to sub castable values (e.g. f - 1u8, 1u8 will be transparently casted to Fraction with .into())
  • Support to div castable values (e.g. f / 1u8, 1u8 will be transparently casted to Fraction with .into())
  • Support to mul castable values (e.g. f * 1u8, 1u8 will be transparently casted to Fraction with .into())
  • Support to add_assign castable values (e.g. f += 1u8, 1u8 will be transparently casted to Fraction with .into())
  • Support to sub_assign castable values (e.g. f -= 1u8, 1u8 will be transparently casted to Fraction with .into())
  • Support to div_assign castable values (e.g. f /= 1u8, 1u8 will be transparently casted to Fraction with .into())
  • Support to mul_assign castable values (e.g. f *= 1u8, 1u8 will be transparently casted to Fraction 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).