Here you can find the source of abs_sum(int[] data)
Parameter | Description |
---|---|
data | a parameter |
public static int abs_sum(int[] data)
//package com.java2s; //License from project: Open Source License public class Main { /**// www.j a v a 2 s . c o m * Return sum of absVal of each index * * @param data * @return */ public static int abs_sum(int[] data) { int sum = 0; for (int i = 0; i < data.length; i++) { sum += Math.abs(data[i]); } return sum; } }