// Path: lib/aelua/jslua/java/util/Random.java
// public class Random {
// 
//   protected int next(int bits) {
//     return com.google.gwt.user.client.Random.nextInt();
//   }
// 
//   public int nextInt() {
//     return com.google.gwt.user.client.Random.nextInt();
//   }
// 
//   public int nextInt(int n) {
//     return com.google.gwt.user.client.Random.nextInt(n);
//   }
// 
//   public long nextLong() {
//     return 0;
//   }
//   public void setSeed(long l) {
//   }
// 
//   public boolean nextBoolean() {
//     return com.google.gwt.user.client.Random.nextBoolean();
//   }
// 
//   public float nextFloat() {
//     return (float) com.google.gwt.user.client.Random.nextDouble();
//   }
// 
//   public double nextDouble() {
//     return com.google.gwt.user.client.Random.nextDouble();
//   }
// }


import java.util.Random;

/*  $Header: //info.ravenbrook.com/project/jili/version/1.1/code/mnj/lua/MathLib.java#1 $
 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package mnj.lua;


/**
 * Contains Lua's math library.
 * The library can be opened using the {@link #open} method.
 * Because this library is implemented on top of CLDC 1.1 it is not as
 * complete as the PUC-Rio math library.  Trigononmetric inverses
 * (EG <code>acos</code>) and hyperbolic trigonometric functions (EG
 * <code>cosh</code>) are not provided.
 */
public final class MathLib extends LuaJavaCallback
{
  // Each function in the library corresponds to an instance of
  // this class which is associated (the 'which' member) with an integer
  // which is unique within this class.  They are taken from the following
  // set.

  private static final int ABS = 1;
  //private static final int acos = 2;
  //private static final int asin = 3;
  //private static final int atan2 = 4;
  //private static final int atan = 5;
  private static final int CEIL = 6;
  //private static final int cosh = 7;
  private static final int COS = 8;
  private static final int DEG = 9;
  private static final int EXP = 10;
  private static final int FLOOR = 11;
  private static final int FMOD = 12;
  //private static final int frexp = 13;
  //private static final int ldexp = 14;
  //private static final int log = 15;
  private static final int MAX = 16;
  private static final int MIN = 17;
  private static final int MODF = 18;
  private static final int POW = 19;
  private static final int RAD = 20;
  private static final int RANDOM = 21;
  private static final int RANDOMSEED = 22;
  //private static final int sinh = 23;
  private static final int SIN = 24;
  private static final int SQRT = 25;
  //private static final int tanh = 26;
  private static final int TAN = 27;


// Path: lib/aelua/jslua/java/util/Random.java
// public class Random {
// 
//   protected int next(int bits) {
//     return com.google.gwt.user.client.Random.nextInt();
//   }
// 
//   public int nextInt() {
//     return com.google.gwt.user.client.Random.nextInt();
//   }
// 
//   public int nextInt(int n) {
//     return com.google.gwt.user.client.Random.nextInt(n);
//   }
// 
//   public long nextLong() {
//     return 0;
//   }
//   public void setSeed(long l) {
//   }
// 
//   public boolean nextBoolean() {
//     return com.google.gwt.user.client.Random.nextBoolean();
//   }
// 
//   public float nextFloat() {
//     return (float) com.google.gwt.user.client.Random.nextDouble();
//   }
// 
//   public double nextDouble() {
//     return com.google.gwt.user.client.Random.nextDouble();
//   }
// }


// Path: lib/aelua/jslua/mnj/lua/MathLib.java
import java.util.Random;

/*  $Header: //info.ravenbrook.com/project/jili/version/1.1/code/mnj/lua/MathLib.java#1 $
 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package mnj.lua;


/**
 * Contains Lua's math library.
 * The library can be opened using the {@link #open} method.
 * Because this library is implemented on top of CLDC 1.1 it is not as
 * complete as the PUC-Rio math library.  Trigononmetric inverses
 * (EG <code>acos</code>) and hyperbolic trigonometric functions (EG
 * <code>cosh</code>) are not provided.
 */
public final class MathLib extends LuaJavaCallback
{
  // Each function in the library corresponds to an instance of
  // this class which is associated (the 'which' member) with an integer
  // which is unique within this class.  They are taken from the following
  // set.

  private static final int ABS = 1;
  //private static final int acos = 2;
  //private static final int asin = 3;
  //private static final int atan2 = 4;
  //private static final int atan = 5;
  private static final int CEIL = 6;
  //private static final int cosh = 7;
  private static final int COS = 8;
  private static final int DEG = 9;
  private static final int EXP = 10;
  private static final int FLOOR = 11;
  private static final int FMOD = 12;
  //private static final int frexp = 13;
  //private static final int ldexp = 14;
  //private static final int log = 15;
  private static final int MAX = 16;
  private static final int MIN = 17;
  private static final int MODF = 18;
  private static final int POW = 19;
  private static final int RAD = 20;
  private static final int RANDOM = 21;
  private static final int RANDOMSEED = 22;
  //private static final int sinh = 23;
  private static final int SIN = 24;
  private static final int SQRT = 25;
  //private static final int tanh = 26;
  private static final int TAN = 27;


  private static final Random rng = new Random();
