Java Double Number mod modValue(double v, int precision)

Here you can find the source of modValue(double v, int precision)

Description

mod Value

License

Open Source License

Declaration

private static long modValue(double v, int precision) 

Method Source Code

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

public class Main {
    private static long modValue(double v, int precision) {
        return precision <= 0 ? (long) v : (long) (v * Math.pow(10, precision));
    }/*w  w  w  .ja  v a 2  s . co m*/

    private static long modValue(float v, int precision) {
        return precision <= 0 ? (long) v : (long) (v * Math.pow(10, precision));
    }
}

Related

  1. modPI2(double angle)
  2. Modulo(double x, double y)
  3. modulo10(double d, boolean round)
  4. moduloAngle(double angle)
  5. moduloTwoPI(double x)