Skip to content

Commit

Permalink
upd float check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mryange committed Mar 13, 2024
1 parent 7232a42 commit ff52d91
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ class OutputUtils {

double realRelativeError = Math.abs(expectDouble - realDouble) / Math.abs(realDouble)
double expectRelativeError = 1e-8

if (expectRelativeError < realRelativeError) {
double realabsoluteError = Math.abs(expectDouble - realDouble)
double expectAbsoluteError = 1e-15
if (expectRelativeError < realRelativeError && expectAbsoluteError < realabsoluteError) {
// Keep the scale of low precision data to solve TPCH cases like:
// "Expect cell is: 0.0395, But real is: 0.039535109"
int expectDecimalPlaces = expectCell.contains(".") ? expectCell.length() - expectCell.lastIndexOf(".") - 1 : 0
Expand Down

0 comments on commit ff52d91

Please sign in to comment.