for(int k=0;k <= odds.GetLength(-1);k++)
The above line of code is supposed to iterate through a two dimensional array of type Double but keeps
I see one or two problems depending on how you intend to use it:
First off, GetLength(ind dimension) returns length of specified dimension, starting from 0. In case of a two-dimensional array, correct indices would be 0 and 1.
The second problem is that you are doing <= instead of < for loop condition, which might also go out of bounds since last index is length-1 and not length.
StriplingWarrior and Gilad Naaman posted code examples so I'll skip that.