Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public static double[] greaterthan(double[] array, double x) {
  2.  
  3. double [] numbers = new double[array.length];
  4.  
  5. int ip = 0;
  6. for (double a : array) {
  7. if (a >= x) {
  8. numbers[ip++] = a;
  9. }
  10. }
  11. return Arrays.copyOf(numbers, ip);
  12. }
  13.  
  14. double[] a = {1, 2, 3, 4, 5, 2.2, 50};
  15.  
  16. [D@15db9742
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement