Skip to content

v0.9.0

Choose a tag to compare

@bjarthur bjarthur released this 31 Aug 18:26
· 13 commits to master since this release
0bd7124

Changes since v0.8.5:

Breaking / behavioral changes

  • Overflow behavior is now consistent across operations. +, - (unary and binary), *, and abs use wrapping (modular) arithmetic, while /, div, fld, cld, rem, and mod use checked arithmetic and throw an error instead of overflowing. In particular, * between Normed values now wraps around on overflow instead of throwing (#236).
  • Division by zero now throws a DivideError for /, div, fld, cld, rem, and mod.
  • Promotion rules have been commonized between Fixed and Normed (#207). Most notably, Fixed values combined with an Integer now promote to a floating-point type (e.g. Q0f7(0.5) + 1 === 1.5f0); previously the result stayed Fixed. Mixed Fixed/Normed operations also promote to floating point.
  • * between Fixed values now rounds ties to even (previously ties rounded up).
  • / between Fixed values now rounds to nearest (previously the result was truncated toward zero) and throws on overflow.
  • print now emits a plain decimal representation without the type suffix, and show output is more consistent across types (#189, #243).
  • The old iterator methods have been removed (#231).
  • On Julia >= 1.9, Statistics support is provided via a package extension (#277, #281).

New features

  • Checked, wrapping, and saturating arithmetic families let callers choose the overflow behavior explicitly: checked_* (extending Base.Checked) plus the exported wrapping_* and saturating_* counterparts for neg/abs/add/sub/mul/div/fld/cld/rem/mod, and wrapping_fdiv/saturating_fdiv/checked_fdiv (#190, #210, #217, #222, #226, #230).
  • round now supports the digits keyword argument (#235).
  • Improved generation of type aliases (#233).
  • Better conversion and overflow error messages (#205, #214).

Performance improvements

  • Faster multiplication for Normed (#213) and Fixed (#220).
  • Improved isapprox (#216).
  • rand uses the sampler-based Random API (#206).

Note: for 64-bit types (Fixed{Int64}, Normed{UInt64}), /, div, rem, and their variants are computed via BigFloat — exact, but slow and allocating compared to the narrower types.

Bug fixes

  • Fixed % Normed{UInt32} on ARM and improved NaN % FixedPoint (#223).
  • Avoided inconsistent unsafe_trunc behavior with BigFloat (#212).

Full changelog: v0.8.5...v0.9.0