Skip to content

Commit

Permalink
Improve log func stability (apache#11808)
Browse files Browse the repository at this point in the history
  • Loading branch information
lewiszlw committed Aug 5, 2024
1 parent c340b6a commit 682bc2e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions datafusion/functions/src/math/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ mod tests {
.expect("failed to convert result to a Float64Array");

assert_eq!(floats.len(), 4);
assert_eq!(floats.value(0), 3.0);
assert_eq!(floats.value(1), 2.0);
assert_eq!(floats.value(2), 4.0);
assert_eq!(floats.value(3), 4.0);
assert!((floats.value(0) - 3.0).abs() < 1e-10);
assert!((floats.value(1) - 2.0).abs() < 1e-10);
assert!((floats.value(2) - 4.0).abs() < 1e-10);
assert!((floats.value(3) - 4.0).abs() < 1e-10);
}
ColumnarValue::Scalar(_) => {
panic!("Expected an array value")
Expand All @@ -291,10 +291,10 @@ mod tests {
.expect("failed to convert result to a Float32Array");

assert_eq!(floats.len(), 4);
assert_eq!(floats.value(0), 3.0);
assert_eq!(floats.value(1), 2.0);
assert_eq!(floats.value(2), 4.0);
assert_eq!(floats.value(3), 4.0);
assert!((floats.value(0) - 3.0).abs() < f32::EPSILON);
assert!((floats.value(1) - 2.0).abs() < f32::EPSILON);
assert!((floats.value(2) - 4.0).abs() < f32::EPSILON);
assert!((floats.value(3) - 4.0).abs() < f32::EPSILON);
}
ColumnarValue::Scalar(_) => {
panic!("Expected an array value")
Expand Down

0 comments on commit 682bc2e

Please sign in to comment.