Skip to content

Conversation

@jacobharris919
Copy link

The TRUNC implementation is still broken. (BUG: https://bz.apache.org/bugzilla/show_bug.cgi?id=62506 )

  1. Bug 62506 reports that TRUNC(0.29, 2) = 0.28
  2. The solution proposed in that bugfix still fails for some calculations (see test case)

The main argument against the proposed fix in 62506 was the performance hit of using BigDecimal for every round() operation. Since the round() methods now use MathX methods which construct a BigDecimal from the Excel string, the TRUNC function can be fixed by using the MathX.roundDown() method.

Use MathX.roundDown, which constructs a BigDecimal
from the Excel string, rather than direct double
arithmetic
@asfgit asfgit closed this in dd9f132 Oct 20, 2020
@pjfanning
Copy link
Member

Merged with dd9f132 - thanks

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