Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * This method checks if the given value is within the deadband range.
     * If so, it returns 0.0 else it returns the unchanged value.
     *
     * @param value specifies the value to be chacked.
     * @param deadband specifies the deadband zone.
     * @return the value 0.0 if within deadband, unaltered otherwise.
     */
    public static double applyDeadband(double value, double deadband) {
        return Math.abs(value) >= deadband ? value : 0.0;
    }
}