FLTK 1.3.2

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

math.h

    00001 //
    00002 // "$Id: math.h 8864 2011-07-19 04:49:30Z greg.ercolano $"
    00003 //
    00004 // Math header file for the Fast Light Tool Kit (FLTK).
    00005 //
    00006 // Copyright 1998-2010 by Bill Spitzak and others.
    00007 //
    00008 // This library is free software. Distribution and use rights are outlined in
    00009 // the file "COPYING" which should have been included with this file.  If this
    00010 // file is missing or damaged, see the license at:
    00011 //
    00012 //     http://www.fltk.org/COPYING.php
    00013 //
    00014 // Please report all bugs and problems on the following page:
    00015 //
    00016 //     http://www.fltk.org/str.php
    00017 //
    00018
    00019 // Xcode on OS X includes files by recursing down into directories.
    00020 // This code catches the cycle and directly includes the required file.
    00021 #ifdef fl_math_h_cyclic_include
    00022 #  include "/usr/include/math.h"
    00023 #endif
    00024
    00025 #ifndef fl_math_h
    00026 #  define fl_math_h
    00027
    00028 #  define fl_math_h_cyclic_include
    00029 #  include <math.h>
    00030 #  undef fl_math_h_cyclic_include
    00031
    00032 #  ifdef __EMX__
    00033 #    include <float.h>
    00034 #  endif
    00035
    00036
    00037 #  ifndef M_PI
    00038 #    define M_PI            3.14159265358979323846
    00039 #    define M_PI_2          1.57079632679489661923
    00040 #    define M_PI_4          0.78539816339744830962
    00041 #    define M_1_PI          0.31830988618379067154
    00042 #    define M_2_PI          0.63661977236758134308
    00043 #  endif // !M_PI
    00044
    00045 #  ifndef M_SQRT2
    00046 #    define M_SQRT2         1.41421356237309504880
    00047 #    define M_SQRT1_2       0.70710678118654752440
    00048 #  endif // !M_SQRT2
    00049
    00050 #  if (defined(WIN32) || defined(CRAY)) && !defined(__MINGW32__) && !defined(__MWERKS__)
    00051
    00052 inline double rint(double v) {return floor(v+.5);}
    00053 inline double copysign(double a, double b) {return b<0 ? -a : a;}
    00054
    00055 #  endif // (WIN32 || CRAY) && !__MINGW32__ && !__MWERKS__
    00056
    00057 #endif // !fl_math_h
    00058
    00059
    00060 //
    00061 // End of "$Id: math.h 8864 2011-07-19 04:49:30Z greg.ercolano $".
    00062 //