Skip to content

build(deps): Bump decimal from 3.1.1 to 3.2.0 - #555

Merged
nelsonic merged 1 commit into
mainfrom
dependabot/hex/decimal-3.2.0
Oct 20, 2026
Merged

nelsonic merged 1 commit into
mainfrom
dependabot/hex/decimal-3.2.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 19, 2026

Copy link
Copy Markdown
Contributor

Bumps decimal from 3.1.1 to 3.2.0.

Release notes

Sourced from decimal's releases.

v3.2.0

Enhancements

  • Make most operations faster. Compared with v3.1.2 on OTP 29, on decimals with up to 20 digits and exponents from -20 to 20, div/2 is about 8x faster, mult/2 6x, add/2 5x, round/3 4x, compare/2 2.7x and normalize/1 2x. On money amounts with two decimals, to_float/1 is about 23x faster, compare/3 18x, div/2 15x, rem/2 and sqrt/1 4x, round/3 2-3x, add/2, sub/2, mult/2, div_int/2 and compare/2 2-2.7x, and parsing 1.4x. from_float/1 and cast/1 of a float are about 3.4x faster and cast/1 of an integer 3x. to_string/1 is unchanged.

  • Add the :subnormal and :clamped signals from the General Decimal Arithmetic spec. :subnormal is signalled for every result whose adjusted exponent is below emin, even an exact one, and :underflow only when such a result is also inexact. A zero result's exponent is kept between emin - precision + 1 and emax, the range of nonzero results, and :clamped is signalled when it has to move: Decimal.mult("0e-3500", "0e-3500") returns 0E-6176 instead of 0E-7000. This also applies to the zero results of division by infinity, of div_int/2 and div_rem/2 with a smaller dividend, and of sqrt/1. A subnormal result that rounds to zero signals :clamped too.

Bug fixes

  • Fix Decimal.div/2 rounding some inexact results the wrong way. Under :half_even and :half_down, a result just above a tie was rounded as a tie, and under :ceiling, :floor and :up, a result whose first discarded digit was 0 was treated as exact even when later digits weren't, so :ceiling and :floor could return a value on the wrong side of the true quotient. About 5% of random divisions at the default precision were affected. :inexact was also missing when the remainder was a power of ten.

  • Fix :up rounding changing exact values. A result whose discarded digits were all zero was still rounded away from zero: with precision: 1 and rounding: :up, Decimal.add(0, Decimal.new("9.0")) returned 10 instead of 9, and Decimal.round(Decimal.new(0), -1, :up) returned 1E+1 instead of 0E+1.

  • Fix rounding carries leaving one digit more than the precision. Rounding 9.99 to precision 2 returned 10.0 instead of 10, and Decimal.div(95, 10) at precision 1 returned 10 instead of 1E+1. This affected every operation that rounds to the context precision, and the results now match the General Decimal Arithmetic spec and Python's decimal.

  • Fix Decimal.sqrt/1 rounding inexact roots as if the first discarded digit were the whole remainder. At precision 9 under :ceiling, Decimal.sqrt(10) returned 3.16227766 instead of 3.16227767, and at

... (truncated)

Changelog

Sourced from decimal's changelog.

v3.2.0 (2026-10-10)

Enhancements

  • Make most operations faster. Compared with v3.1.2 on OTP 29, on decimals with up to 20 digits and exponents from -20 to 20, div/2 is about 8x faster, mult/2 6x, add/2 5x, round/3 4x, compare/2 2.7x and normalize/1 2x. On money amounts with two decimals, to_float/1 is about 23x faster, compare/3 18x, div/2 15x, rem/2 and sqrt/1 4x, round/3 2-3x, add/2, sub/2, mult/2, div_int/2 and compare/2 2-2.7x, and parsing 1.4x. from_float/1 and cast/1 of a float are about 3.4x faster and cast/1 of an integer 3x. to_string/1 is unchanged.

  • Add the :subnormal and :clamped signals from the General Decimal Arithmetic spec. :subnormal is signalled for every result whose adjusted exponent is below emin, even an exact one, and :underflow only when such a result is also inexact. A zero result's exponent is kept between emin - precision + 1 and emax, the range of nonzero results, and :clamped is signalled when it has to move: Decimal.mult("0e-3500", "0e-3500") returns 0E-6176 instead of 0E-7000. This also applies to the zero results of division by infinity, of div_int/2 and div_rem/2 with a smaller dividend, and of sqrt/1. A subnormal result that rounds to zero signals :clamped too.

Bug fixes

  • Fix Decimal.div/2 rounding some inexact results the wrong way. Under :half_even and :half_down, a result just above a tie was rounded as a tie, and under :ceiling, :floor and :up, a result whose first discarded digit was 0 was treated as exact even when later digits weren't, so :ceiling and :floor could return a value on the wrong side of the true quotient. About 5% of random divisions at the default precision were affected. :inexact was also missing when the remainder was a power of ten.

  • Fix :up rounding changing exact values. A result whose discarded digits were all zero was still rounded away from zero: with precision: 1 and rounding: :up, Decimal.add(0, Decimal.new("9.0")) returned 10 instead of 9, and Decimal.round(Decimal.new(0), -1, :up) returned 1E+1 instead of 0E+1.

  • Fix rounding carries leaving one digit more than the precision. Rounding 9.99 to precision 2 returned 10.0 instead of 10, and Decimal.div(95, 10) at precision 1 returned 10 instead of 1E+1. This affected every operation that rounds to the context precision, and the results now match the General Decimal Arithmetic spec and Python's decimal.

  • Fix Decimal.sqrt/1 rounding inexact roots as if the first discarded digit were the whole remainder. At precision 9 under :ceiling,

... (truncated)

Commits
  • 401f262 Release v3.2.0
  • 551f620 Describe the unreleased changes from the user's side in the changelog
  • d76ab46 Make round/3 invalid where quantize is
  • 3c90af4 Merge commit from fork
  • 786e573 Performance: recover the correctness-fix regressions, skip rounding results t...
  • 90317c0 Document that integer new/1 and new/3 skip the parse limits (#253)
  • b279a2c Keep subnormal results and signal subnormal and clamped (#252)
  • b96e60d Make compare/3 exact and compare/2 raise for NaN (#251)
  • dc8cf66 Raise ArgumentError from to_integer/1 for NaN and Infinity (#250)
  • b47ae81 Validate the context in Context.set/1 and with/2 (#249)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [decimal](https://github.com/ericmj/decimal) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/ericmj/decimal/releases)
- [Changelog](https://github.com/ericmj/decimal/blob/main/CHANGELOG.md)
- [Commits](ericmj/decimal@v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: decimal
  dependency-version: 3.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code labels Oct 19, 2026

@nelsonic nelsonic left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dependabot 馃馃摃馃憣

@nelsonic
nelsonic merged commit 8d639b5 into main Oct 20, 2026
1 check passed
@nelsonic
nelsonic deleted the dependabot/hex/decimal-3.2.0 branch October 20, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant