Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accumulate min doesn't evaluate correctly with more than 18 digits BigDecimal #6180

Closed
tkobayas opened this issue Dec 4, 2024 · 1 comment
Assignees

Comments

@tkobayas
Copy link
Contributor

tkobayas commented Dec 4, 2024

Rule like this

  when
        accumulate(
            Fact($bd: bd),
            $min: min($bd))

doesn't evaluate correctly if facts have BigDecimal with more than 18 digits

##### insert fact: Fact [bd=2024043020240501120000](doubleValue=2.024043020240501E21)
##### insert fact: Fact [bd=2024043020240501130000](doubleValue=2.024043020240501E21)
##### insert fact: Fact [bd=2024043020240501150000](doubleValue=2.024043020240501E21)
##### insert fact: Fact [bd=2024043020240501170000](doubleValue=2.024043020240501E21)

because NumericMinAccumulateFunction uses doubleValue.

Workaround: Create a custom accumulate function like BigDecimalMinAccumulateFunction

@tkobayas
Copy link
Contributor Author

Done by
#6186

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

No branches or pull requests

1 participant