MCPcopy Create free account
hub / github.com/apache/datafusion / log_decimal256

Function log_decimal256

datafusion/functions/src/math/log.rs:173–186  ·  view source on GitHub ↗
(value: i256, scale: i8, base: f64)

Source from the content-addressed store, hash-verified

171}
172
173fn log_decimal256(value: i256, scale: i8, base: f64) -> Result<f64, ArrowError> {
174 // Try to convert to i128 for the optimized path
175 match value.to_i128() {
176 Some(v) => log_decimal128(v, scale, base),
177 None => {
178 // For very large Decimal256 values, use f64 computation
179 let value_f64 = value.to_f64().ok_or_else(|| {
180 ArrowError::ComputeError(format!("Cannot convert {value} to f64"))
181 })?;
182 let scale_factor = 10f64.powi(scale as i32);
183 Ok((value_f64 / scale_factor).log(base))
184 }
185 }
186}
187
188impl ScalarUDFImpl for LogFunc {
189 fn name(&self) -> &str {

Callers 1

invoke_with_argsMethod · 0.85

Calls 2

log_decimal128Function · 0.85
logMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…