Java Ceil ceil(double[] array)

Here you can find the source of ceil(double[] array)

Description

Rounds up each element of a given double array.

License

Open Source License

Parameter

Parameter Description
array Array to be rounded up

Return

Rounded up array

Declaration

public static double[] ceil(double[] array) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2016 Pablo Pavon-Marino.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 *
 * Contributors:/*from   w w  w. j  a  v  a  2  s  .  c  o m*/
 *     Pablo Pavon-Marino - Jose-Luis Izquierdo-Zaragoza, up to version 0.3.1
 *     Pablo Pavon-Marino - from version 0.4.0 onwards
 ******************************************************************************/

public class Main {
    /**
     * Rounds up each element of a given {@code double} array.
     *
     * @param array Array to be rounded up
     * @return Rounded up array
     */
    public static double[] ceil(double[] array) {
        double[] out = new double[array.length];
        for (int i = 0; i < array.length; i++)
            out[i] = Math.ceil(array[i]);

        return out;
    }
}

Related

  1. ceil(double value, int scale)
  2. ceil(double Var1)
  3. ceil(double x)
  4. ceil(double x)
  5. ceil(double x, double y)
  6. ceil(final double num)
  7. ceil(final double num)
  8. ceil(float f)
  9. ceil(float f)