Java floor floorData(float[] data, float floor)

Here you can find the source of floorData(float[] data, float floor)

Description

If a data point is below 'floor' make it equal to floor.

License

Open Source License

Parameter

Parameter Description
data the data to floor
floor the floored value

Declaration

public static void floorData(float[] data, float floor) 

Method Source Code

//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;
            }
        }
    }
}

Related

  1. floor_double(double a)
  2. floor_double(double value)
  3. floor_double_long(double d)
  4. floor_float(float f)
  5. floorAndCrop(final double x, final int min, final int max)
  6. floorDay(long milli)
  7. floorDiv(final int x, final int y)
  8. floorDiv(int dividend, int divisor)
  9. floorDiv(int dividend, int divisor)