Skip to content

fix outermost division placement#2298

Merged
jycor merged 9 commits intomainfrom
james/div
Jan 30, 2024
Merged

fix outermost division placement#2298
jycor merged 9 commits intomainfrom
james/div

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Jan 29, 2024

MySQL round appends 4 places of precision to their division operators, but only on the very last division operation.
All inner divisions need to preserve as much precision as possible. To track this, we have a divScale variable in.

We also have an opScale to track if an operation is the outermost operator, for other rounding/precision reasons.

We were getting these values mixed up, leading to results with incorrect precision.

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm

@jycor jycor merged commit 24b7a21 into main Jan 30, 2024
@jycor jycor deleted the james/div branch January 30, 2024 21:33
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.

2 participants