Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: neogenie/fastnum

v0.7.3

14 Oct 17:31

Choose a tag to compare

Fixed

  • Sign Extension Not Performed in From<i32/i64>, Cast, and TryCast for Signed Integers #52.

Internal

  • Refactored integer conversion implementation for better code organization and maintainability.
  • Simplified signed integer conversion methods by removing redundant intermediate logic.
  • Improved macro handling for literal construction to properly support token concatenation.
  • Reorganized test infrastructure with macro-based test generation for comprehensive coverage of integer conversions across different bit widths (64/128/256/512).
  • Consolidated test structure by moving conversion tests into dedicated modules with automatic test generation for all supported integer types.

v0.7.2

21 Sep 19:28
211160f

Choose a tag to compare

Fixed

  • Incorrect division result for numbers with large amount of decimal digits #49.
  • Fix no_std build #50.

Changed

  • Improve debug formatting of Decimal and UnsignedDecimal.

Examples

  • Add no_std wasm example #50.

v0.7.1

30 Aug 21:22

Choose a tag to compare

Fixed

  • .ln() panic regression (0.2.10 -> 0.7.0) #46.

Changed

  • Improve log implementation #38.

Documentation

  • Documentation for Decimal::with_rounding_mode and Decimal::with_ctx:
    • Clarified that when changing the rounding mode, any existing extra precision (if present) is immediately rounded
      using the new rule.
    • Clarified that applying a new context may trigger traps if the current value already has signaling flags set (
      e.g., INEXACT) and the new context enables traps for those signals; this may result in a panic depending on
      build/configuration.
  • Minor fixes.

v0.7.0

21 Aug 19:32

Choose a tag to compare

Added

  • Big-integer conversion APIs #44:
    • Parsing from raw bytes:

      • from_radix_be(buf, radix) -> Option<Self>
      • from_radix_le(buf, radix) -> Option<Self>
    • Encoding to raw bytes:

      • to_radix_be(radix) -> Vec<u8>
      • to_radix_le(radix) -> Vec<u8>
    • String conversion helpers:

      • parse_str_radix(s, radix) -> Self (panicking variant)
      • parse_bytes(buf, radix) -> Option<Self>
      • to_str_radix(radix) -> String

Documentation

  • Conversion documentation expanded with clearer semantics, base handling, and examples.
  • Improved doc comments for:
    • Base-aware parsing behavior and panic conditions.
    • Byte-level import/export helpers.
    • parse_str(s) and from_str(s) for big integers recognize 0x and 0b prefixes (decimal remains default without a prefix).

Internal

  • Conversion code reorganized into focused modules:
    • bint/convert/{from_bytes,to_bytes,from_str,to_str}.rs
  • Macro routing for conversion implementation is simplified and deduplicated.

v0.6.2

17 Aug 21:20

Choose a tag to compare

Changed

  • Minor internal performance improvements.

v0.6.1

16 Aug 08:55

Choose a tag to compare

Changed

  • Minor performance improvements.

v0.6.0

15 Aug 20:19

Choose a tag to compare

Breaking changes

  • Removed previously deprecated Decimal methods:
    • from_scale (use quantum instead).
    • normalized (use reduce instead).
    • with_scale (use rescale instead).

Added

  • Decimal truncation API (#39):
    • Decimal::trunc() — truncates to integral with no fractional portion without rounding.
    • Decimal::trunc_with_scale(scale) — truncates to the specified scale without rounding.

Changed

  • Internal documentation macro routing for decimal type aliases refined (no public API impact).

Documentation

  • Minor fixes.
  • Added a dedicated “Truncate” section with behavior details and examples.

Internal

  • Introduced an internal truncation implementation integrated with scaling and extra-precision handling to ensure true
    truncation semantics (no rounding).

v0.5.0

14 Aug 22:44

Choose a tag to compare

Added

  • Type conversion traits for integers and decimals:
    • Cast — type-safe, infallible conversion (e.g., widening or lossless transforms).
    • TryCast — checked conversion returning an error on overflow, sign mismatch, or incompatible scale.
    • Supported families: unsigned/signed big integers (U64, U128, U256, U512, U1024, and I64, I128,
      I256, I512, I1024) #42 and decimals (UD64, UD128, UD256, UD512, UD1024, and D64, D128, D256,
      D512, D1024).
    • Common scenarios:
      • Widening cast for integers — via Cast.
      • Checked narrowing cast — via TryCast, with overflow errors.
      • Conversions between unsigned and signed integers — TryCast rejects negative/out-of-range values.
      • Conversions between UD* and D* — proper sign/scale propagation with checks in TryCast.
  • Const-generic “dimensions” for conversion direction checks:
    • Internal Widen/Narrow markers ensure Cast/TryCast correctness without unstable generic const expressions.

Deprecated

  • Decimal .transmute() is now deprecated (since "0.5.0"); removal is planned for a future major release.
    Use .resize() or cast via Cast and TryCast traits instead.

Documentation

  • Minor fixes and clarifications; added usage examples for type conversions.

v0.4.5

12 Aug 12:11

Choose a tag to compare

Documentation

  • Minor fixes.

v0.4.4

12 Aug 09:45

Choose a tag to compare

Documentation

  • Minor fixes.