Skip to content

Native decimal 32/64/256 bit support for log #17555

@Jefffrey

Description

@Jefffrey

Is your feature request related to a problem or challenge?

#17023 introduced support for doing log on decimal 128 & 256 bit. 256 is handled by downcasting to 128 if value can fit in the range, otherwise raising an error.

Describe the solution you'd like

Look into supporting log on decimal 256 values that don't fit into decimal 128 bit.

Describe alternatives you've considered

No response

Additional context

Code reference:

/// Binary function to calculate an integer logarithm of Decimal128 `value` using `base` base
/// Returns error if base is invalid or if value is out of bounds of Decimal128
fn log_decimal256(value: i256, scale: i8, base: f64) -> Result<f64, ArrowError> {
match value.to_i128() {
Some(value) => log_decimal128(value, scale, base),
None => Err(ArrowError::NotYetImplemented(format!(
"Log of Decimal256 larger than Decimal128 is not yet supported: {value}"
))),
}
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions