home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dokpr1.zip / mmath.h < prev    next >
C/C++ Source or Header  |  1995-06-28  |  3KB  |  113 lines

  1.  
  2. /**************************************************************************
  3.  *                                                                        *
  4.  *                                                                        *
  5.  *          This code is copyright (c) 1994                               *
  6.  *                     Athena Design, Inc.                                *
  7.  *                                                                        *
  8.  *                                                                        *
  9.  *                ALL RIGHTS RESERVED                                     *
  10.  *                                                                        *
  11.  *                                                                        *
  12.  *                                                                        *
  13.  *                                                                        *
  14.  *                                                                        *
  15.  **************************************************************************/
  16.  
  17. /*
  18.     This header file does the right thing with the math and floating point
  19.     stuff
  20.     7-21-94 dpp
  21. */
  22.  
  23. #ifndef _MH_mesa_math
  24.  
  25. #define _MH_mesa_math
  26.  
  27. #include <math.h>
  28.  
  29. #if defined(M2Z) && !defined(__HIGHC__)
  30. #include <builtin.h>
  31. // #include <math.h>
  32. #include <float.h>
  33.  
  34. #pragma map(pow,"my_masked_pow")
  35. #pragma map(cos,"my_masked_cos")
  36. #pragma map(acos,"my_masked_acos")
  37. #pragma map(asin,"my_masked_asin")
  38. #pragma map(atan,"my_masked_atan")
  39. #pragma map(atan2,"my_masked_atan2")
  40. #pragma map(ceil,"my_masked_ceil")
  41. #pragma map(cosh,"my_masked_cosh")
  42. #pragma map(exp,"my_masked_exp")
  43. // #pragma map(fabs,"my_masked_fabs")
  44. #pragma map(floor,"my_masked_floor")
  45. #pragma map(log,"my_masked_log")
  46. #pragma map(log10,"my_masked_log10")
  47. #pragma map(sin,"my_masked_sin")
  48. #pragma map(sinh,"my_masked_sinh")
  49. #pragma map(sqrt,"my_masked_sqrt")
  50. #pragma map(tan,"my_masked_tan")
  51. #pragma map(tanh,"my_masked_tanh")
  52.  
  53.  
  54. double _Optlink my_masked_pow(double,double);
  55. double _Optlink my_masked_atan2(double,double);
  56. double _Optlink my_masked_cos(double);
  57. double _Optlink my_masked_acos(double);
  58. double _Optlink my_masked_asin(double);
  59. double _Optlink my_masked_atan(double);
  60. double _Optlink my_masked_ceil(double);
  61. double _Optlink my_masked_cosh(double);
  62. double _Optlink my_masked_exp(double);
  63. double _Optlink my_masked_floor(double);
  64. double _Optlink my_masked_log(double);
  65. double _Optlink my_masked_log10(double);
  66. double _Optlink my_masked_sin(double);
  67. double _Optlink my_masked_sinh(double);
  68. double _Optlink my_masked_sqrt(double);
  69. double _Optlink my_masked_tan(double);
  70. double _Optlink my_masked_tanh(double);
  71.  
  72. /*
  73. // (from Standard C Library, Plauger)
  74. extern double _Stod( const char *s, char **endptr );
  75. extern short dmul(  double *, double );
  76. extern double _Dtento( double, short );
  77. extern short _Dunscale( short *, double *);
  78. extern short _Dnorm( unsigned short *ps );
  79. extern short _Dscale( double *px, short exp );
  80.  
  81. #define _DFRAC ((1<<_DOFF)-1)
  82. #define _DMASK (0x7fff&~_DFRAC)
  83. #define _DMAX ((1<<(15-_DOFF))-1)
  84. #define _DSIGN 0x8000
  85.  
  86. #define FINITE -1
  87. #define INF        1
  88. #define NAN        2
  89.  
  90. #if _D0==3
  91. // little-endian
  92. //#define _D0    3
  93. #define _D1    2
  94. #define _D2 1
  95. #define _D3 0
  96. #else
  97. // big-endian
  98. #define _D1 1
  99. #define _D2 2
  100. #define _D3 3
  101. #endif
  102.  
  103. */
  104.  
  105. // ifdef M2Z
  106. #else
  107. #include <math.h>
  108. // ifdef M2Z
  109. #endif
  110.  
  111. // ifndef _MH_mesa_math
  112. #endif
  113.