FileDocCategorySizeDatePackage
FloatTest.javaAPI DocExample431Thu Apr 27 15:47:22 BST 2000tuning.floats

FloatTest.java

package tuning.floats;

public class FloatTest
{
  public static void main(String[] args)
  {
    int REPEAT = Integer.parseInt(args[0]);
    double x = 0;
    long time = System.currentTimeMillis();
    for (int i = REPEAT; i > 0; i--)
      x = runtest(i);
    System.out.println(x + " in time " + (System.currentTimeMillis()-time));
  }
  public static double runtest(int i)
  {
    return Math.sqrt(i);
  }
}