In your C# code, you're using integer division:
(8 - 1) / 8 === 7 / 8 === 0
, giving you
10 + 0 === 10
elements.
In VB.NET, you're using floating-point division:
(8 - 1) / 8 === 7 / 8 === 0.875
; VB then rounds that number up, giving you
10 + 1 === 11
elements.
If you want to perform integer division in VB.NET, use the
\
operator instead:
Dim src As Byte() = New Byte(10 + (8 - 1) \ 8 - 1) {}
\ Operator - Visual Basic | Microsoft Docs[
^]