home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / MATH_.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  2KB  |  59 lines

  1. /* Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* math_.h */
  20. /* Generic substitute for math.h */
  21.  
  22. /* We must include std.h before any file that includes sys/types.h. */
  23. #include "std.h"
  24.  
  25. #ifdef VMS
  26. /*  DEC VAX/VMS C comes with a math.h file, but GNU VAX/VMS C does not. */
  27. #  include "vmsmath.h"
  28. #else
  29. #  include <math.h>
  30. #endif
  31.  
  32. /* math.h is different for Turbo and Unix.... */
  33. #ifndef M_PI
  34. #  ifdef PI
  35. #    define M_PI PI
  36. #  else
  37. #    define M_PI 3.14159265358979324
  38. #  endif
  39. #endif
  40.  
  41. /* Factors for converting between degrees and radians */
  42. #define degrees_to_radians (M_PI / 180.0)
  43. #define radians_to_degrees (180.0 / M_PI)
  44.  
  45. /* Define the hypot procedure on those few systems that don't provide it. */
  46. #ifdef _IBMR2
  47. /* The RS/6000 has hypot, but math.h doesn't declare it! */
  48. extern double hypot(double, double);
  49. #else
  50. #  if !defined(__TURBOC__) && !defined(BSD4_2) && !defined(VMS)
  51. #    define hypot(x,y) sqrt((x)*(x)+(y)*(y))
  52. #  endif
  53. #endif
  54.  
  55. #ifdef OSK
  56. /* OSK has atan2 and ldexp, but math.h doesn't declare them! */
  57. extern double atan2(), ldexp();
  58. #endif
  59.