finding the index of a value in a multi dimentional array of doubles
im having trouble writing function index of value in multi dimentional array. value in [*,0] need check column 0 value. have far:
public int locate(double[,] arr, double value) { int w = arr.getlength(0); (int x = 0; x < w; x++) { if (arr[x, 0].equals(value)) { return x; } return -1; } }
arr double array large range of distinct values, , value double looking in arr[*,0].
this give me error saying not code paths return value. wrong code , how fix it?
change to:
public int locate(double[,] arr, double value) { int w = arr.getlength(0); (int x = 0; x < w; x++) { if (arr[x, 0].equals(value)) { return x; } } return -1; }
mitja
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment