Java Array Remove removeNaN(double[] x1)

Here you can find the source of removeNaN(double[] x1)

Description

remove Na N

License

Open Source License

Declaration

private static double[] removeNaN(double[] x1) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU General Public License as published by      //

import java.util.Arrays;

public class Main {
    private static double[] removeNaN(double[] x1) {
        int i;/* w  ww.j  av  a 2s.  c  o m*/

        for (i = 0; i < x1.length; i++) {
            if (Double.isNaN(x1[i])) {
                break;
            }
        }

        i = i > x1.length ? x1.length : i;

        return Arrays.copyOf(x1, i);
    }
}

Related

  1. removeIndex(String[] args, int index)
  2. removeIndex(T[] array, int index)
  3. removeLast(byte[] target, int end)
  4. removeLowScore(int[] array)
  5. removeMethodsOption(String[] args)
  6. removeNodes(T[] array, T sampleNode)
  7. removeNull(T[] data)
  8. removeNullElements(String[] x)
  9. removeNulls(Object[] arr)