Skip to main content

cast_decimal_to_f32

Function cast_decimal_to_f32 

Source
fn cast_decimal_to_f32<D, F>(
    array: &dyn Array,
    as_float: &F,
    scale: i8,
) -> Result<ArrayRef, ArrowError>
where D: DecimalType + ArrowPrimitiveType, F: Fn(D::Native) -> f64,
Expand description

Casts a decimal array to Float32, rounding each value once. Same shape as cast_decimal_to_f64, with the smaller bounds an f32 allows: integers are exact below 2^24, and 10^k only up to k = 10.