Fraction 0.4.0 is out (lossless floats drop-in replacement)

Hi Rustaceans,

The new version of Fraction 0.4.0 is out.

Fraction is designed to be a drop-in lossless replacement for floats, targeting developers comfort and efficiency as well as providing flexible generic types on top of which you can build your own Float and Decimal types suiting your needs best.

The most tangible features in the new release:

  • Decimal type implementation on top of Fraction. Lossless decimal arithmetic with infinite precision even for bad numbers such as 1/3, 1/7 etc.
  • Lossless division and as such decimal representation for Fractions with infinite precision
  • PostgreSQL support for Numeric/Decimal type (postgres crate integration)
  • Juniper support (juniper crate)
  • Types with dynamic growth into heap on overflows
  • Generic type conversions (usize -> i8, i8 -> u8, etc), as such flexible value construction - Fraction::new(1u16, 2i8)
  • serde support

A bit more details in the CHANGELOG.md

docs.rs uses outdated version of rustdoc which couldn't build the documentation properly, so while they're fixing this I put the documentation here (that link is also available from the github readme).

9 Likes