numcodecs_bit_round

Function bit_round

Source
pub fn bit_round<T: Float, S: Data<Elem = T>, D: Dimension>(
    data: ArrayBase<S, D>,
    keepbits: u8,
) -> Result<Array<T, D>, BitRoundCodecError>
Expand description

Floating-point bit rounding, which drops the specified number of bits from the floating point mantissa.

See https://github.com/milankl/BitInformation.jl for the the original implementation in Julia.

ยงErrors

Errors with BitRoundCodecError::ExcessiveKeepBits if keepbits exceeds T::MANITSSA_BITS.