Here you can find the source of subtract(double[] values, double value)
Parameter | Description |
---|---|
values | collection of values |
value | a value to be subtracted |
public static double[] subtract(double[] values, double value)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w. jav a2 s. c o m*/ * Subtracts a value from every value in the array * @param values collection of values * @param value a value to be subtracted * @return */ public static double[] subtract(double[] values, double value) { double[] result = new double[values.length]; for (int i = 0; i < values.length; i++) { result[i] = values[i] - value; } return result; } }