Skip to content

v0.4.0

Compare
Choose a tag to compare
@akubera akubera released this 07 Jul 04:01
· 299 commits to trunk since this release

Changes

  • no_std feature support #97

    • To disable std, change your Cargo.toml dependency to:
      bigdecimal = { version = "0.4", default-features = false }
    • Still depends on alloc (I think we will always need dynamic storage)
  • Allow user to set default max-precision at compile time

    • Use environment variable RUST_BIGDECIMAL_DEFAULT_PRECISION
    • Defaults to 100
    • This "is the number of 3s in calculation of 1/3"
    • Better solutions are being considered
      • This is tricky: Do we set a global variable? Do we require every math operation to specify precision? Do we store precision in each BigDecimal? Is that set from a global variable? Should we use macros to balance explicit precision and tidy code?
  • Add rounding module with RoundingMode enum

    • Used in new method: BigDecimal::with_scale_round
    • Finally, you can truncate your decimal with the rounding you prefer!
    • Will be coming to more methods, soon
  • Reimplement parsing from {32,64}-bit float values

    • Use binary bits instead of formatting to string and parsing
    • Already surprising users: #103
  • Bump Minimum Supported Rust Version from 1.34 to 1.43

    • Was breaking a few test dependencies
    • Able to do more at compile time
    • Probably wont affect too many people?
  • Fix implementations of to_u128/to_i128 #101

    • Default implementations cast values to 64 bit ints
  • Fix issue where underscores after the decimal counted towards total digit count (giving wrong exponent) #99

  • Fix case of panic during rounding #90

  • Add preliminary benchmarking code

    • Unsatisfied with statistics: more work to be done with Criterion
    • Eventually get some answers on how best to parse strings, and in what format should the digits be stored
  • Started using my crazy approach to unit testing