Does anyone know what is the best way to check that none of the elements in a 2D array are NaN or Infinity? My array can be large so I would prefer not to loop through it. I am thinking of using

```
double[,] myArray;
if ( !double.IsNaN(myArray.Cast<double>().Min() ) && !double.IsInfinity( myArray.Cast<double>().Min() )
{
    // have finite values as elements
}

```

for the NaN and infinity check. I only need to know if there are any elements in the array that are NaN or infinity so I figure just checking the smallest element in the array should do the trick for the NaN and for infinity. Is there a better way to do this? Thank you for any help or suggestions you may be able to provide.