Recently, the correlation between the document needs to be used to use the logarithmic calculation. The following method is found: 1 of the key is: 1 Java standard package provides a method of calculating natural logarithm, 2 Other logarithm calculations can be converted to Calculation of natural logaries. Here is a repost: but don't know who is the original author. Later, I later found this connection: http://www.cs.utsa.edu/~wagner/laws/alogs.html is still a professional spirit: Here is his description:
Java Supplies A Function to Calculate Natural Logs, Base E = 2.718281828459045. To Calculate Logs To Other Bases, You NEED TO MULTIPLY BY A Fixed Constant: for A Log Base B Multiply by 1 / LOGEB
Sun's J2SE provides a computational natural logarithm method - Double Java.lang.math.log (double). Please see the following code: double x = math.log (5); equivalent to the following mathematical equation: x = ln 5 or x = LOGE5 where E is the number of endotel or natural.
What should I do if you want to do a different log? Unfortunately, we haven't calculated the logarithm of 10 or 2 is 2. But they are the most used in calculating the logarithm. To solve this problem, we must recall the mathematics and logarithm equations that have been learned in school: logX (y) = LOGE (X) / LOGE (Y) This requires a simple Java program to implement: public Class Logarithm {static public double log (double value, double base) {return math.log (value) / math.log (base);}} The log 100 is very simple in 10, the logarithm is very simple: Double log = LOGARITHM.LOG (100, 10); // log is 2.0 512 The right number of 2 is: double log = logarithm.log (512, 2); // LOG IS 9.0 two simple methods It is also very useful: static public double log2 (double value) {Return log (value, 2.0);} static public double log10 (double value) {Return log (Value, 10.0);} ------- ------- Scimark Benchmark consists of many general computing elements established in scientific computing applications, each processing different behavior patterns in memory access floating point operations. These elements are: Fast Fourier Conversion (FFT), continuous relaxation iteration (Sor: Over-Relaxation Items), Monte - Carlo Points, Sprull Multiplication, and Filled Metomorphic Decomposition (LU) for complex linear systems. Scimark initially developed by Java (http://math.nist.gov/scimark), later by Chris Re and Wener Vogels to C # (http://math.nist.gov/scimark). Note that this implementation does not use unsafe code, which will increase its running speed by 5 to 10 percentage points.