com.softsynth.jmsl.util
Class JMSLMath

java.lang.Object
  extended by 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
 
Constructor Summary
JMSLMath()
           
 
Method Summary
static int highestPowerOfTwoLessThan(int n)
           
static double log(double base, double n)
           
static double logBase2(double n)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ln2

public static final double ln2
precalculated for logBase2 operation

Constructor Detail

JMSLMath

public JMSLMath()
Method Detail

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)