Skip to content

Conversation

tompng
Copy link
Member

@tompng tompng commented Aug 22, 2025

BigDecimal.limit(1)
BigMath.exp(123, 100) # This should return 100 digit precision value.
# Of course internal calculation uses precision larger than 100.

Wrapped with save_limit

BigDecimal.save_limit do
  BigDecimal.limit(0)
  ...
end

Compact diff: https://github.com/ruby/bigdecimal/pull/411/files?w=1

sqrt has the same problem. It will be fixed in #381

@tompng tompng added the bug label Aug 22, 2025
@tompng tompng force-pushed the exp_log_pow_with_preclimit branch from f214251 to a756609 Compare August 22, 2025 14:41
@tompng tompng merged commit f6bfd2f into ruby:master Aug 22, 2025
79 checks passed
@tompng tompng deleted the exp_log_pow_with_preclimit branch August 22, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant