/****Copyright (c) 2001-2007  Alexandros V. Gerbessiotis. 
 **** All rights reserved.                               
 ****Permission to use, copy, modify, and distribute this software,
 ****and to incorporate it, in whole or in part, into 
 ****other software,is hereby granted without fee, provided that
 ****  (1) the above copyright notice and this permission 
 ****      notice appear in all copies of the source code, and 
 ****      the above copyright notice appear in clearly visible 
 ****      form on all supporting documentation and distribution 
 ****      media, and
 ****     (2) any redistribution of the software, in original
 ****         or modified form, be without fee and subject to
 ****         these same conditions.
 ****   No guarantee, whatsoever, is offered that the code works as
 ****   advertised or is absent of any, even damaging,
 ****   side-effects. Use this code at your own personal risk.
 ****/
#include <memory.h>
#include <math.h>
#include "ai.h"

#define	SQRT(X)	((int)ceil(sqrt((double) (X))))
#define	SQRT_F(X)	((int)floor(sqrt((double) (X))))
#define CEIL(X,Y)       (((X) != 0)?(1+ (X-1)/Y):0)  
#define FLOOR(X,Y)      ((X)/(Y))  
#define LEFT(X,Y)       ((X)-(X/Y)*(Y))
#define POWER(X,Y)      pow((double)(X),(double)(Y))
#define EXP(X)          exp((double)(X))

#define MAX(X,Y)        ((X)>= (Y)?(X):(Y))
#define MX(X,Y)        ((X)> (Y)?(X):(Y))

#define MIN(X,Y)        ((X)<= (Y)?(X):(Y))
