home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / math.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-04  |  2.8 KB  |  95 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Friday, September 15, 1989 at 6:14 PM
  4.     Math.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1985-1992
  9.     All rights reserved
  10.     
  11.     25 Feb 93 - Rewritten by Preston Gardner to be ANSI conforming.
  12.     
  13. Change log (relative to MPW 3.1 Math.h)
  14.  
  15.     26 Oct 89 - Jon Okada
  16.         Removed #include of SANE.h.
  17.         Added declaration of __inf() and changed #define of HUGE_VAL.
  18.         Changed #define of pow to declaration.
  19.         Added declarations of sqrt, log, exp, tan, cos, sin,
  20.           and atan (formerly in SANE.h).
  21.  
  22. ************************************************************/
  23.  
  24.  
  25. #ifndef __MATH_H__
  26. #define __MATH_H__
  27.  
  28. /*  Strictly conforming implementations must have the parameters to these routines
  29.     be double, not long double.  They still get evaluated to long double precision on the 68K.
  30.     We expect that a lot of this confusion will eventually get settled by NCEG and then
  31.     we will do it the NCEG way.
  32. */
  33. #if (__STDC__ == 1) || defined(powerc)
  34. #define _float_eval double
  35. #else /*__STDC__*/
  36. #define _float_eval long double
  37. #endif /*__STDC__*/
  38.  
  39. #define HUGE_VAL __inf()
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. _float_eval sin(_float_eval _x);  /* We put underscores on the formal parameter names to reduce name space pollution.
  45.                                      Plum-Hall tests require that we do this:  they have macros called exp, size etc. */
  46. _float_eval cos(_float_eval _x);
  47. _float_eval tan(_float_eval _x);
  48. _float_eval asin(_float_eval _x);
  49. _float_eval acos(_float_eval _x);
  50. _float_eval atan(_float_eval _x);
  51. _float_eval atan2(_float_eval _y,_float_eval _x);
  52. _float_eval sinh(_float_eval _x);
  53. _float_eval cosh(_float_eval _x);
  54. _float_eval tanh(_float_eval _x);
  55. _float_eval exp(_float_eval _x);
  56. _float_eval log(_float_eval _x);
  57. _float_eval log10(_float_eval _x); 
  58. _float_eval frexp(_float_eval _x,int *_exp);
  59. _float_eval ldexp(_float_eval _x,int _n);
  60.  
  61. _float_eval modf(_float_eval _x, _float_eval *_ip);
  62.  
  63. #ifdef powerc
  64. /*
  65.  *    If you use modf() you must decide which version you mean: modf(),
  66.  *    modff() or modfl().  The usual promotions to long double don't
  67.  *    help here because we're using a pointer.
  68.  *
  69.  *    NOTE:    both modff() and modfl() are not ANSI defined functions;
  70.  *            if you use it, your code may not be portable.
  71.  */
  72. float modff(float _x,float *_ip);
  73. long double modfl(long double _x, long double *_ip);
  74. #endif
  75.  
  76. _float_eval pow(_float_eval _x,_float_eval _y);
  77. _float_eval sqrt(_float_eval _x);
  78. _float_eval floor(_float_eval _x); 
  79. _float_eval ceil(_float_eval _x);
  80. _float_eval fmod(_float_eval _x,_float_eval _y);
  81. _float_eval fabs(_float_eval _x);
  82.  
  83. _float_eval __inf(void);
  84. /*
  85.  * NOTE:    hypot() is not an ANSI defined function;
  86.  *            if you use it, your code may not be portable.
  87.  */
  88. _float_eval hypot(_float_eval _x,_float_eval _y);
  89.  
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93.  
  94. #endif
  95.