Here you can find the source of floorData(float[] data, float floor)
Parameter | Description |
---|---|
data | the data to floor |
floor | the floored value |
public static void floorData(float[] data, float floor)
//package com.java2s; /*//from w ww . java2s .c om * Copyright 1999-2002 Carnegie Mellon University. * Portions Copyright 2002 Sun Microsystems, Inc. * Portions Copyright 2002 Mitsubishi Electric Research Laboratories. * All Rights Reserved. Use is subject to license terms. * * See the file "license.terms" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL * WARRANTIES. * */ public class Main { /** * If a data point is below 'floor' make it equal to floor. * * @param data the data to floor * @param floor the floored value */ public static void floorData(float[] data, float floor) { for (int i = 0; i < data.length; i++) { if (data[i] < floor) { data[i] = floor; } } } }