home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / DTOTP6.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  1KB  |  46 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. $Header: c:/bnxl/rcs/dtotp6.h 1.1 1995/05/01 00:04:08 bnelson Exp $
  5.  
  6. $Log: dtotp6.h $
  7. Revision 1.1  1995/05/01 00:04:08  bnelson
  8.  
  9. - Include file companion to dtotp6.c, see notes contained there.
  10. */
  11.  
  12.  
  13. #include "dirport.h"
  14.  
  15.  
  16. #ifndef D2TOTP6_H_
  17. #define     D2TOTP6_H_
  18.  
  19. #ifdef __TURBOC__
  20. #pragma     option -a-       /* Force byte alignment in struct */
  21. #endif
  22.  
  23. #ifdef __GNUC__
  24. #define PAK        __attribute__((packed))
  25. #else
  26. #define PAK
  27. #endif
  28.  
  29. #ifdef MONOSPACE_6           /* Just to be safe... */
  30.  #define     double_to_tp6    DBL2TP
  31.  #define     tp6_to_double    TP2DBL
  32. #endif
  33.  
  34. typedef struct {
  35.     unsigned char be   PAK;     /* biased exponent */
  36.     unsigned int  v1   PAK;     /* lower 16 bits of mantissa */
  37.     unsigned int  v2   PAK;     /* next  16 bits of mantissa */
  38.     unsigned int  v3:7 PAK;     /* upper  7 bits of mantissa */
  39.     unsigned int  s :1 PAK;     /* sign bit */
  40. } tp_real_t;
  41.  
  42. extern tp_real_t  double_to_tp6(double x);
  43. extern double     tp6_to_double(tp_real_t r);
  44.  
  45. #endif    /* D2TOTP6_H_ */
  46.