// Path: src/org/opensourcephysics/stp/util/MyMath.java
// public class MyMath {
//   private MyMath() {} // don't allow users to instantiate this class
// 
//   public static double logBase10(double n) {
//     return Math.log(n)/Math.log(10);
//   }
// 
//   public static int factorial(int n) {
//     if(n<0) {
//       throw new IllegalArgumentException("Can't compute the factorial of a number less than 0");
//     }
//     int total = 1;
//     for(int i = n; i>1; i--) {
//       total *= i;
//     }
//     return total;
//   }
// 
//   public static double factorial(double n) {
//     if(n<0) {
//       throw new IllegalArgumentException("Can't compute the factorial of a number less than 0");
//     }
//     double total = 1;
//     for(double i = n; i>1; i--) {
//       total *= i;
//     }
//     return total;
//   }
// 
//   public static double stirling(int n) {
//     if(n==0) {
//       return 0;
//     }
//     double result = n*Math.log(n)-n+0.5*Math.log(2.0*Math.PI*n);
//     return result;
//   }
// 
// }


import org.opensourcephysics.controls.*;
import org.opensourcephysics.frames.*;
import org.opensourcephysics.stp.util.MyMath;
    }
    int maxDenominator = 0;
    int minDenominator = 0;
    if(denominator1>denominator2) {
      maxDenominator = denominator1;
      minDenominator = denominator2;
    } else {
      maxDenominator = denominator2;
      minDenominator = denominator1;
    }
    int total = numerator;
    for(int i = numerator-1; i>maxDenominator; i--) {
      total *= i;
    }
    return total/(MyMath.factorial(minDenominator));
  }

  public void resetCalculation() {
    plotFrame.clearData();
    plotFrame.repaint();
    tableFrame.clearData();
    tableFrame.refreshTable();
    E = 12;
    Na = 4;
    Nb = 8;
    control.setValue("E", E);
    control.setValue("Na", Na);
    control.setValue("Nb", Nb);
  }

// Path: src/org/opensourcephysics/stp/util/MyMath.java
// public class MyMath {
//   private MyMath() {} // don't allow users to instantiate this class
// 
//   public static double logBase10(double n) {
//     return Math.log(n)/Math.log(10);
//   }
// 
//   public static int factorial(int n) {
//     if(n<0) {
//       throw new IllegalArgumentException("Can't compute the factorial of a number less than 0");
//     }
//     int total = 1;
//     for(int i = n; i>1; i--) {
//       total *= i;
//     }
//     return total;
//   }
// 
//   public static double factorial(double n) {
//     if(n<0) {
//       throw new IllegalArgumentException("Can't compute the factorial of a number less than 0");
//     }
//     double total = 1;
//     for(double i = n; i>1; i--) {
//       total *= i;
//     }
//     return total;
//   }
// 
//   public static double stirling(int n) {
//     if(n==0) {
//       return 0;
//     }
//     double result = n*Math.log(n)-n+0.5*Math.log(2.0*Math.PI*n);
//     return result;
//   }
// 
// }


// Path: src/org/opensourcephysics/stp/entropy/EntropyApp2.java
import org.opensourcephysics.controls.*;
import org.opensourcephysics.frames.*;
import org.opensourcephysics.stp.util.MyMath;

    }
    int maxDenominator = 0;
    int minDenominator = 0;
    if(denominator1>denominator2) {
      maxDenominator = denominator1;
      minDenominator = denominator2;
    } else {
      maxDenominator = denominator2;
      minDenominator = denominator1;
    }
    int total = numerator;
    for(int i = numerator-1; i>maxDenominator; i--) {
      total *= i;
    }
    return total/(MyMath.factorial(minDenominator));
  }

  public void resetCalculation() {
    plotFrame.clearData();
    plotFrame.repaint();
    tableFrame.clearData();
    tableFrame.refreshTable();
    E = 12;
    Na = 4;
    Nb = 8;
    control.setValue("E", E);
    control.setValue("Na", Na);
    control.setValue("Nb", Nb);
  }

  public void calculate() {