fastnum 0.7.4

Fast decimal numbers library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::bint::{intrinsics::_transmute, UInt};

#[allow(unsafe_code)]
#[inline(always)]
pub const unsafe fn transmute<const N: usize, const M: usize>(v: UInt<N>) -> UInt<M> {
    if N <= M {
        UInt::from_digits(_transmute::<N, M, N>(v.digits()))
    } else {
        debug_assert!(v.last_digit_index() < M);
        debug_assert!(v.bits() <= UInt::<M>::BITS);
        UInt::from_digits(_transmute::<N, M, M>(v.digits()))
    }
}