Skip to main content

scaled_div

Function scaled_div 

Source
fn scaled_div<T: DecimalType>(
    l: T::Native,
    r: T::Native,
    mul_pow: i8,
) -> Result<T::Native, ArrowError>
Expand description

Divides l * 10^mul_pow by r a digit at a time, without forming the scaled numerator. Used when scaling l would overflow T::Native, which it does well before the quotient does.

Runs on magnitudes and restores the sign last, so it truncates toward zero.