Converts a float array to an int array using rounding.
(float[] arr)
| 2548 | |
| 2549 | /** Converts a float array to an int array using rounding. */ |
| 2550 | public static int[] toIntR(float[] arr) { |
| 2551 | int n = arr.length; |
| 2552 | int[] temp = new int[n]; |
| 2553 | for (int i=0; i<n; i++) |
| 2554 | temp[i] = (int)Math.floor(arr[i]+0.5); |
| 2555 | return temp; |
| 2556 | } |
| 2557 | |
| 2558 | /** Converts an int array to a float array. */ |
| 2559 | public static float[] toFloat(int[] arr) { |
no outgoing calls
no test coverage detected