pub fn stack_sum<T, const N: usize>(arr: &StackArray<T, N>) -> Twhere T: Float + NumAssignOps + Copy + Default + Zero,
Calculate sum without heap allocation