Here you can find the source of abs(double[] arr)
Parameter | Description |
---|---|
arr | a float array |
public static void abs(double[] arr)
//package com.java2s; //License from project: Open Source License public class Main { /**/*w w w . ja v a 2 s .c o m*/ * Computes the absolute value for each element in the array, in place. * * @param arr a short array */ public static void abs(short[] arr) { for (int i = 0; i < arr.length; i++) { arr[i] = (short) Math.abs(arr[i]); } } /** * Computes the absolute value for each element in the array, in place. * * @param arr an integer array */ public static void abs(int[] arr) { for (int i = 0; i < arr.length; i++) { arr[i] = Math.abs(arr[i]); } } /** * Computes the absolute value for each element in the array, in place. * * @param arr a long array */ public static void abs(long[] arr) { for (int i = 0; i < arr.length; i++) { arr[i] = Math.abs(arr[i]); } } /** * Computes the absolute value for each element in the array, in place. * * @param arr a float array */ public static void abs(float[] arr) { for (int i = 0; i < arr.length; i++) { arr[i] = Math.abs(arr[i]); } } /** * Computes the absolute value for each element in the array, in place. * * @param arr a float array */ public static void abs(double[] arr) { for (int i = 0; i < arr.length; i++) { arr[i] = Math.abs(arr[i]); } } }