Here you can find the source of floor(double[] array)
Parameter | Description |
---|---|
array | Array to be rounded down |
public static double[] floor(double[] array)
//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://w ww .j av a 2 s. co 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 down each element of a given {@code double} array. * * @param array Array to be rounded down * @return Rounded down array */ public static double[] floor(double[] array) { double[] out = new double[array.length]; for (int i = 0; i < array.length; i++) out[i] = Math.floor(array[i]); return out; } }