Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Sep 18, 2024
1 parent 0f6266c commit c68432e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arrow-data/src/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ pub fn validate_decimal_precision(value: i128, precision: u8) -> Result<(), Arro
#[inline]
pub fn is_validate_decimal_precision(value: i128, precision: u8) -> bool {
let idx = usize::from(precision) - 1;
precision > DECIMAL128_MAX_PRECISION
precision <= DECIMAL128_MAX_PRECISION
&& value >= MIN_DECIMAL_FOR_EACH_PRECISION[idx]
&& value <= MAX_DECIMAL_FOR_EACH_PRECISION[idx]
}
Expand Down Expand Up @@ -794,7 +794,7 @@ pub fn validate_decimal256_precision(value: i256, precision: u8) -> Result<(), A
#[inline]
pub fn is_validate_decimal256_precision(value: i256, precision: u8) -> bool {
let idx = usize::from(precision) - 1;
precision > DECIMAL128_MAX_PRECISION
precision <= DECIMAL256_MAX_PRECISION
&& value >= MIN_DECIMAL_BYTES_FOR_LARGER_EACH_PRECISION[idx]
&& value <= MAX_DECIMAL_BYTES_FOR_LARGER_EACH_PRECISION[idx]
}

0 comments on commit c68432e

Please sign in to comment.