com.softsynth.jmsl.util
Class JMSLMath
java.lang.Object
com.softsynth.jmsl.util.JMSLMath
public class JMSLMath
- extends java.lang.Object
Some static methods for logarithms and other misc useful math
- Author:
- Nick Didkovsky, email: didkovn@mail.rockefeller.edu, (c) 2004 Nick Didkovsky, all rights reserved.
Field Summary |
static double |
ln2
precalculated for logBase2 operation |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ln2
public static final double ln2
- precalculated for logBase2 operation
JMSLMath
public JMSLMath()
logBase2
public static double logBase2(double n)
- Returns:
- log base 2 of argument
log
public static double log(double base,
double n)
- Returns:
- log base n of m (general algorithm: logm(n) = ln(n)/ln(base)
highestPowerOfTwoLessThan
public static int highestPowerOfTwoLessThan(int n)
main
public static void main(java.lang.String[] args)