Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.0 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // float10.h
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef _FLOAT10_H_
  9. #define _FLOAT10_H_
  10. typedef struct {
  11. double x;
  12. } UDOUBLE;
  13. #pragma pack(4)
  14. typedef UCHAR u_char;
  15. typedef struct {
  16. u_char ld[10];
  17. } _ULDOUBLE;
  18. #pragma pack()
  19. #pragma pack(4)
  20. typedef struct {
  21. u_char ld12[12];
  22. } _ULDBL12;
  23. #pragma pack()
  24. #define MAX_MAN_DIGITS 21
  25. #define MAX_10_LEN 30 //max length of string including NULL
  26. // specifies '%f' format
  27. #define SO_FFORMAT 1
  28. typedef struct _FloatOutStruct {
  29. short exp;
  30. char sign;
  31. char ManLen;
  32. char man[MAX_MAN_DIGITS+1];
  33. } FOS;
  34. char * _uldtoa (_ULDOUBLE *px, int maxchars, char *ldtext);
  35. int $I10_OUTPUT(_ULDOUBLE ld, int ndigits,
  36. unsigned output_flags, FOS *fos);
  37. //
  38. // return values for strgtold12 routine
  39. //
  40. #define SLD_UNDERFLOW 1
  41. #define SLD_OVERFLOW 2
  42. #define SLD_NODIGITS 4
  43. //
  44. // return values for internal conversion routines
  45. // (12-byte to long double, double, or float)
  46. //
  47. typedef enum {
  48. INTRNCVT_OK,
  49. INTRNCVT_OVERFLOW,
  50. INTRNCVT_UNDERFLOW
  51. } INTRNCVT_STATUS;
  52. unsigned int
  53. __strgtold12(_ULDBL12 *pld12,
  54. char * *p_end_ptr,
  55. char *str,
  56. int mult12);
  57. INTRNCVT_STATUS _ld12tod(_ULDBL12 *pld12, UDOUBLE *d);
  58. void _ld12told(_ULDBL12 *pld12, _ULDOUBLE *pld);
  59. void _ldtold12(_ULDOUBLE *pld, _ULDBL12 *pld12);
  60. void _atodbl(UDOUBLE *d, char *str);
  61. void _atoldbl(_ULDOUBLE *ld, char *str);
  62. //
  63. // Simple FLOAT86 utilities
  64. //
  65. typedef struct {
  66. ULONG64 significand : 64;
  67. UINT exponent : 17;
  68. UINT sign : 1;
  69. } FLOAT82_FORMAT;
  70. double
  71. Float82ToDouble(const FLOAT128* FpReg82);
  72. void
  73. DoubleToFloat82(double f, FLOAT128* FpReg82);
  74. #endif // #ifndef _FLOAT10_H_