Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

fl_math.h

00001 /*
00002  * $Id: fl_math.h,v 1.1 2003/02/02 03:04:01 parshin Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_MATH_H_
00023 #define _FL_MATH_H_
00024 
00025 //
00026 // The purpose of this header file is to make math.h look the same as
00027 // Unix on other operating systems.
00028 //
00029 
00030 /* maybe we should define this?  */
00031 /* #define __NO_LONG_DOUBLE_MATH */
00032 
00033 #include <math.h>
00034 
00035 #ifdef _WIN32
00036 // things missing from <math.h>:
00037 # include <float.h>
00038 
00039 # ifndef M_PI
00040 #  define M_PI      3.14159265358979323846
00041 #  define M_PI_2    1.57079632679489661923
00042 #  define M_PI_4    0.78539816339744830962
00043 #  define M_1_PI    0.31830988618379067154
00044 #  define M_2_PI    0.63661977236758134308
00045 #  define M_SQRT2   1.41421356237309504880
00046 #  define M_SQRT1_2 0.70710678118654752440
00047 # endif
00048 
00049 # define rint(v)    floor((v)+.5)
00050 # define copysign   _copysign
00051 # define drand48()  ((double)rand()/RAND_MAX)
00052 # define srand48(n) srand((n));
00053 
00054 #endif
00055 
00056 #ifdef __EMX__
00057 # include <float.h>
00058 #endif
00059 
00060 #ifndef M_PI
00061 # define M_PI          3.14159265358979323846
00062 #endif
00063 
00064 #define rintf(v)    floorf((v)+.5f)
00065 
00066 #ifdef __alpha // powf is broken on alphas, at least in gcc
00067 # define powf(a,b)  pow(a,b)
00068 #endif
00069 #ifdef _WIN32
00070 # define expm1f(a)  expm1(a)
00071 # define log1pf(a)  log1p(a)
00072 #endif
00073 
00074 #endif

Generated on Thu Jul 31 15:33:44 2003 for eFLTK by doxygen1.2.15