Skip to content

Fix out-of-bounds decimals() generation#4747

Merged
Zac-HD merged 1 commit into
HypothesisWorks:masterfrom
Zac-HD:claude/zen-euler-c2ytW
May 27, 2026
Merged

Fix out-of-bounds decimals() generation#4747
Zac-HD merged 1 commit into
HypothesisWorks:masterfrom
Zac-HD:claude/zen-euler-c2ytW

Conversation

@Zac-HD
Copy link
Copy Markdown
Member

@Zac-HD Zac-HD commented May 27, 2026

Compute the integer bounds for fixed-point decimals exactly with Fraction. Previously they were derived via a limited-precision Context.divide whose precision was based only on the integer-part magnitude, so bounds with more fractional digits than places could round during the division and make ceil/floor over- or undershoot, yielding values outside min_value/max_value.

Fixes #4651.

Compute the integer bounds for fixed-point decimals exactly with Fraction.
Previously they were derived via a limited-precision Context.divide whose
precision was based only on the integer-part magnitude, so bounds with more
fractional digits than `places` could round during the division and make
ceil/floor over- or undershoot, yielding values outside min_value/max_value.

https://claude.ai/code/session_01PaoeogHgq8MwBbXGi5kP4v
@Zac-HD Zac-HD merged commit 1aa02fc into HypothesisWorks:master May 27, 2026
77 checks passed
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.

st.decimals can return out of bounds values with places

3 participants