Java Number Round roundedLog(double value, double exponent)

Here you can find the source of roundedLog(double value, double exponent)

Description

a rounded logarithm to avoid issues with jvm dependant math functions

License

Open Source License

Declaration

public static double roundedLog(double value, double exponent) 

Method Source Code

//package com.java2s;

public class Main {
    public final static double ROUNDED_LOG_PRECISION = 10000;

    /**//w  w  w. jav  a 2  s  .c  o  m
     * a rounded logarithm to avoid issues with jvm dependant math functions
     */
    public static double roundedLog(double value, double exponent) {
        return Math.round(log(value, exponent) * ROUNDED_LOG_PRECISION) / ROUNDED_LOG_PRECISION;
    }

    public static double log(double value, double exponent) {
        return Math.log(value) / Math.log(exponent);
    }
}

Related

  1. rounded(double value, int places, int ceilOrFloor)
  2. ROUNDED_DIV(long a, long b)
  3. rounded_shift_down(long x, int n)
  4. roundedApply(double value, double percent, double delta)
  5. roundedDollarValue(double d)
  6. roundedLog10(int n)
  7. roundedSatisfaction(double value)
  8. rounder(float value, int digits)
  9. roundf(float value)