home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / psion / opp16f_zip / INCLUDE / P / MATH.OPH < prev    next >
Encoding:
Text File  |  1995-12-21  |  1.6 KB  |  62 lines

  1. #define P_MATH_OPH
  2.  
  3. #define P_FLT_MAXEXP 1023 /* maximum magnitude of float exponent */ 
  4. #define P_FLT_MANT 53 /* number of bits in mantissa (binary precission) */ 
  5. #define P_FLT_PREC 15 /* approximate precision in decimal digits */ 
  6.  
  7. /* Cracked form of double float */
  8.  
  9. STRUCT P_CRKFLT
  10.     sign%
  11.     exp%
  12.     mant&(2)
  13. ENDS
  14.  
  15. /* values for sign above */
  16.  
  17. #define P_FLT_ZERO 0 /* value is zero */ 
  18. #define P_FLT_POS 1 /* value is positive */ 
  19. #define P_FLT_NEG 2 /* value is negative */ 
  20.  
  21. /* format specification for p_dtob() */
  22.  
  23. STRUCT P_DTOB
  24.     type#
  25.     width#
  26.     ndec#
  27.     point#
  28.     triad#
  29.     trilen#
  30. ENDS
  31.  
  32. /* values for type in the above */
  33.  
  34. #define P_DTOB_FIXED 0 /* fixed number of decimap points */ 
  35. #define P_DTOB_EXPONENT 1 /* exponent notation */ 
  36. #define P_DTOB_GENERAL 2 /* general format */ 
  37.  
  38. /* Struct for p_poly() */
  39.  
  40. STRUCT P_POLY
  41.     num%
  42.     c(1)
  43. ENDS
  44.  
  45. /* DOUBLE constants */
  46.  
  47. #define SQHF .70710678118654752440 /* Square root of a half */ 
  48. #define RLN2 1.4426950408889634 /* Reciprocal of ln 2 */ 
  49. #define RLN10 0.4342944819032518 /* Reciprocal of ln 10 */ 
  50. #define RLG2 0.3010299956639812 /* Reciprocal of log 2 */ 
  51. #define PI  3.1415926535897932 /* Pi */ 
  52. #define RPI  0.3183098861837907 /* Reciprocal of Pi */ 
  53. #define PIB2 1.5707963267948966 /* pi/2 */ 
  54. #define DRPI 0.6366197723675813 /* 2/pi */ 
  55. #define SQT3 1.7320508075688773 /* Square root of three */ 
  56. #define MSQ3 0.2679491924311227 /* 2 minus square root of three */ 
  57. #define RADTODEG 57.29577951308232 /* 1 radian in degrees (180/pi) */ 
  58. #define DEGTORAD 0.017453292519943296 /* 1 degree in radians */ 
  59.  
  60. #define MOD(a,b)    (a-(a/b)*b)
  61.  
  62.