/********************************************************************* === Expanded Math Object === * Arith [ Arith.js ] * updated 2001/05/28 mail : peace@skipup.com home : http://www.skipup.com/~peace/ *********************************************************************/ // public final class Arith function Arith(){ var A = Arith ; /***************************** SET_STATIC_MEMBER - BEGIN *****************************/ // public static final double A.ROOT2 = Math.SQRT2 ; A.ROOT3 = Math.pow( 3 , 0.5 ); // public static final double A.square = function( p ){ return p*p ; }; // public static final number A.random = function(){ var a = arguments ; var n = a.length ; switch( n ){ case 0 : return Math.round( Math.random() ); case 1 : return a[0][ Math.floor( Math.random()*a[0].length ) ]; default : return a[ Math.floor( Math.random()*n ) ]; } }; // public static final double A.ffrandom = function( s , e ){ return s+(e-s)*Math.random(); }; // public static final number A.total = function(){ var s = 0 ; var a = arguments ; switch( a.length ){ case 1 : for(var i=0;i Math.floor( n/2 ) ) r = n-r ; return Math.floor( this.P( n , r )/this.P( r ) ); }; // public static final string A.toString = function(){ return "Arith" ; }; /***************************** SET_STATIC_MEMBER - E N D *****************************/ } new Arith();