Java Double Number Truncate trunc(double value, double threshold)

Here you can find the source of trunc(double value, double threshold)

Description

trunc

License

Open Source License

Declaration

public static double trunc(double value, double threshold) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double trunc(double value, double threshold) {
        return Math.max(Math.min(value, threshold), -threshold);
    }//from w  w  w  . ja va  2 s.  co  m
}

Related

  1. trunc(double value)
  2. trunc(double value, int dp)
  3. trunc(double value, int len)
  4. trunc(double x)
  5. trunc(double x)