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

Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Oct 8, 2025

BigMath methods was aligned with BigMath.log precision handling that raises "precision must be an Integer" for non-integers.
This is different from BigDecimal#add handling that converts with to_int. This commit unifies all precision handling to match BigDecimal#add series.

In addition, bigdecimal tests in ruby/spec requires non-integer precision to be accepted.

Round (BigDecimal and Float) also accepts non-integer ndigits

1.23456789.round(3.5) #=> 1.235
BigDecimal(1.23456789).round(3.5) #=> 0.1235e1

@tompng tompng changed the title Unify all precision validation to be consistend with BigDecimal#add Unify all precision validation to be consistent with BigDecimal#add Oct 9, 2025
BigMath methods was aligned with BigMath.log precision handling that raises "precision must be an Integer" for non-integers.
This is different from BigDecimal#add handling that converts with to_int. This commit unifies all precision handling to match BigDecimal#add series.
In addition, bigdecimal tests in ruby/spec requires non-integer precision to be accepted.
@tompng tompng force-pushed the prec_to_int branch 3 times, most recently from 4c0a80a to 2830efa Compare October 9, 2025 15:38
@tompng tompng merged commit 8f34991 into ruby:master Oct 9, 2025
81 checks passed
@tompng tompng deleted the prec_to_int branch October 9, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant