Source code of Windows XP (NT5)
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.

537 lines
20 KiB

  1. #pragma warning( disable : 4200 )
  2. //-----------------------------------------------------------------------------
  3. // Package Title ratpak
  4. // File ratpak.h
  5. // Author Timothy David Corrie Jr. ([email protected])
  6. // Copyright (C) 1995-99 Microsoft
  7. // Date 01-16-95
  8. //
  9. //
  10. // Description
  11. //
  12. // Infinite precision math package header file, if you use ratpak.lib you
  13. // need to include this header.
  14. //
  15. //-----------------------------------------------------------------------------
  16. #include "CalcErr.h"
  17. #define BASEXPWR 31L // Internal log2(BASEX)
  18. #define BASEX 0x80000000 // Internal nRadix used in calculations, hope to raise
  19. // this to 2^32 after solving scaling problems with
  20. // overflow detection esp. in mul
  21. typedef unsigned long MANTTYPE;
  22. typedef unsigned __int64 TWO_MANTTYPE;
  23. enum eNUMOBJ_FMT {
  24. FMT_FLOAT, // returns floating point, or exponential if number is too big
  25. FMT_SCIENTIFIC, // always returns scientific notation
  26. FMT_ENGINEERING // always returns engineering notation such that exponent is a multiple of 3
  27. };
  28. enum eANGLE_TYPE {
  29. ANGLE_DEG, // Calculate trig using 360 degrees per revolution
  30. ANGLE_RAD, // Calculate trig using 2 pi radians per revolution
  31. ANGLE_GRAD // Calculate trig using 400 gradients per revolution
  32. };
  33. typedef enum eNUMOBJ_FMT NUMOBJ_FMT;
  34. typedef enum eANGLE_TYPE ANGLE_TYPE;
  35. typedef int BOOL;
  36. //-----------------------------------------------------------------------------
  37. //
  38. // NUMBER type is a representation of a generic sized generic nRadix number
  39. //
  40. //-----------------------------------------------------------------------------
  41. typedef struct _number
  42. {
  43. long sign; // The sign of the mantissa, +1, or -1
  44. long cdigit; // The number of digits, or what passes for digits in the
  45. // nRadix being used.
  46. long exp; // The offset of digits from the nRadix point
  47. // (decimal point in nRadix 10)
  48. MANTTYPE mant[0];
  49. // This is actually allocated as a continuation of the
  50. // NUMBER structure.
  51. } NUMBER, *PNUMBER, **PPNUMBER;
  52. //-----------------------------------------------------------------------------
  53. //
  54. // RAT type is a representation nRadix on 2 NUMBER types.
  55. // pp/pq, where pp and pq are pointers to integral NUMBER types.
  56. //
  57. //-----------------------------------------------------------------------------
  58. typedef struct _rat
  59. {
  60. PNUMBER pp;
  61. PNUMBER pq;
  62. } RAT, *PRAT;
  63. //-----------------------------------------------------------------------------
  64. //
  65. // LINKEDLIST is an aid for division, it contains foreward and reverse links
  66. // to a list of NUMBERS.
  67. //
  68. //-----------------------------------------------------------------------------
  69. typedef struct _linkedlist
  70. {
  71. PNUMBER pnum;
  72. struct _linkedlist *llnext;
  73. struct _linkedlist *llprev;
  74. } LINKEDLIST, *PLINKEDLIST;
  75. #if !defined( TRUE )
  76. #define TRUE 1
  77. #endif
  78. #if !defined( FALSE )
  79. #define FALSE 0
  80. #endif
  81. #define MAX_LONG_SIZE 33 // Base 2 requires 32 'digits'
  82. //-----------------------------------------------------------------------------
  83. //
  84. // List of useful constants for evaluation, note this list needs to be
  85. // initialized.
  86. //
  87. //-----------------------------------------------------------------------------
  88. extern PNUMBER num_one;
  89. extern PNUMBER num_two;
  90. extern PNUMBER num_five;
  91. extern PNUMBER num_six;
  92. extern PNUMBER num_nRadix;
  93. extern PNUMBER num_ten;
  94. extern PRAT ln_ten;
  95. extern PRAT ln_two;
  96. extern PRAT rat_zero;
  97. extern PRAT rat_neg_one;
  98. extern PRAT rat_one;
  99. extern PRAT rat_two;
  100. extern PRAT rat_six;
  101. extern PRAT rat_half;
  102. extern PRAT rat_ten;
  103. extern PRAT pt_eight_five;
  104. extern PRAT pi;
  105. extern PRAT pi_over_two;
  106. extern PRAT two_pi;
  107. extern PRAT one_pt_five_pi;
  108. extern PRAT e_to_one_half;
  109. extern PRAT rat_exp;
  110. extern PRAT rad_to_deg;
  111. extern PRAT rad_to_grad;
  112. extern PRAT rat_qword;
  113. extern PRAT rat_dword;
  114. extern PRAT rat_word;
  115. extern PRAT rat_byte;
  116. extern PRAT rat_360;
  117. extern PRAT rat_400;
  118. extern PRAT rat_180;
  119. extern PRAT rat_200;
  120. extern PRAT rat_nRadix;
  121. extern PRAT rat_smallest;
  122. extern PRAT rat_negsmallest;
  123. extern PRAT rat_max_exp;
  124. extern PRAT rat_min_exp;
  125. extern PRAT rat_min_long;
  126. // MANT returns a long pointer to the mantissa of number 'a'
  127. #define MANT(a) ((a)->mant)
  128. // DUPNUM Duplicates a number taking care of allocation and internals
  129. #define DUPNUM(a,b) destroynum(a);createnum( a, b->cdigit ); \
  130. memcpy( a, b, (int)( sizeof( NUMBER ) + ( b->cdigit )*(sizeof(MANTTYPE)) ) );
  131. // DUPRAT Duplicates a rational taking care of allocation and internals
  132. #define DUPRAT(a,b) destroyrat(a);createrat(a);DUPNUM((a)->pp,(b)->pp);DUPNUM((a)->pq,(b)->pq);
  133. // LOG*RADIX calculates the integral portion of the log of a number in
  134. // the base currently being used, only accurate to within ratio
  135. #define LOGNUMRADIX(pnum) (((pnum)->cdigit+(pnum)->exp)*ratio)
  136. #define LOGRATRADIX(prat) (LOGNUMRADIX((prat)->pp)-LOGNUMRADIX((prat)->pq))
  137. // LOG*2 calculates the integral portion of the log of a number in
  138. // the internal base being used, only accurate to within ratio
  139. #define LOGNUM2(pnum) ((pnum)->cdigit+(pnum)->exp)
  140. #define LOGRAT2(prat) (LOGNUM2((prat)->pp)-LOGNUM2((prat)->pq))
  141. #if defined( DEBUG )
  142. //-----------------------------------------------------------------------------
  143. //
  144. // Debug versions of rational number creation and destruction routines.
  145. // used for debugging allocation errors.
  146. //
  147. //-----------------------------------------------------------------------------
  148. #define createrat(y) y=_createrat();fprintf( stderr, "createrat %lx %s file= %s, line= %d\n", y, # y, __FILE__, __LINE__ )
  149. #define destroyrat(x) fprintf( stderr, "destroyrat %lx file= %s, line= %d\n", x, __FILE__, __LINE__ ),_destroyrat(x),x=NULL
  150. #define createnum(y,x) y=_createnum(x);fprintf( stderr, "createnum %lx %s file= %s, line= %d\n", y, # y, __FILE__, __LINE__ );
  151. #define destroynum(x) fprintf( stderr, "destroynum %lx file= %s, line= %d\n", x, __FILE__, __LINE__ ),_destroynum(x),x=NULL
  152. #else
  153. #define createrat(y) y=_createrat()
  154. #define destroyrat(x) _destroyrat(x),x=NULL
  155. #define createnum(y,x) y=_createnum(x)
  156. #define destroynum(x) _destroynum(x),x=NULL
  157. #endif
  158. //-----------------------------------------------------------------------------
  159. //
  160. // Defines for checking when to stop taylor series expansions due to
  161. // precision satisfaction.
  162. //
  163. //-----------------------------------------------------------------------------
  164. // RENORMALIZE, gets the exponents non-negative.
  165. #define RENORMALIZE(x) if ( (x)->pp->exp < 0 ) { \
  166. (x)->pq->exp -= (x)->pp->exp; \
  167. (x)->pp->exp = 0; \
  168. } \
  169. if ( (x)->pq->exp < 0 ) { \
  170. (x)->pp->exp -= (x)->pq->exp; \
  171. (x)->pq->exp = 0; \
  172. }
  173. // TRIMNUM ASSUMES the number is in nRadix form NOT INTERNAL BASEX!!!
  174. #define TRIMNUM(x) if ( !ftrueinfinite ) { \
  175. long trim = (x)->cdigit - maxout-ratio;\
  176. if ( trim > 1 ) \
  177. { \
  178. memmove( MANT(x), &(MANT(x)[trim]), sizeof(MANTTYPE)*((x)->cdigit-trim) ); \
  179. (x)->cdigit -= trim; \
  180. (x)->exp += trim; \
  181. } \
  182. }
  183. // TRIMTOP ASSUMES the number is in INTERNAL BASEX!!!
  184. #define TRIMTOP(x) if ( !ftrueinfinite ) { \
  185. long trim = (x)->pp->cdigit - (maxout/ratio) - 2;\
  186. if ( trim > 1 ) \
  187. { \
  188. memmove( MANT((x)->pp), &(MANT((x)->pp)[trim]), sizeof(MANTTYPE)*((x)->pp->cdigit-trim) ); \
  189. (x)->pp->cdigit -= trim; \
  190. (x)->pp->exp += trim; \
  191. } \
  192. trim = min((x)->pp->exp,(x)->pq->exp);\
  193. (x)->pp->exp -= trim;\
  194. (x)->pq->exp -= trim;\
  195. }
  196. #define CLOSE_ENOUGH_RAT(a,b) ( ( ( ( ( a->pp->cdigit + a->pp->exp ) - \
  197. ( a->pq->cdigit + a->pq->exp ) ) - ( ( b->pp->cdigit + b->pp->exp ) - \
  198. ( b->pq->cdigit + b->pq->exp ) ) ) * ratio > maxout ) || fhalt )
  199. #define SMALL_ENOUGH_RAT(a) (zernum(a->pp) || ( ( ( a->pq->cdigit + a->pq->exp ) - ( a->pp->cdigit + a->pp->exp ) - 1 ) * ratio > maxout ) || fhalt )
  200. //-----------------------------------------------------------------------------
  201. //
  202. // Defines for setting up taylor series expansions for infinite precision
  203. // functions.
  204. //
  205. //-----------------------------------------------------------------------------
  206. #define CREATETAYLOR() PRAT xx=NULL;\
  207. PNUMBER n2=NULL; \
  208. PRAT pret=NULL; \
  209. PRAT thisterm=NULL; \
  210. DUPRAT(xx,*px); \
  211. mulrat(&xx,*px); \
  212. createrat(pret); \
  213. pret->pp=longtonum( 0L, BASEX ); \
  214. pret->pq=longtonum( 0L, BASEX );
  215. #define DESTROYTAYLOR() destroynum( n2 ); \
  216. destroyrat( xx );\
  217. destroyrat( thisterm );\
  218. destroyrat( *px );\
  219. trimit(&pret);\
  220. *px=pret;
  221. // SUM(a,b) is the rational equivalent of a += b
  222. #define SUM(a,b) addnum( &a, b, BASEX);
  223. // INC(a) is the rational equivalent of a++
  224. // Check to see if we can avoid doing this the hard way.
  225. #define INC(a) if ( a->mant[0] < BASEX - 1 ) \
  226. { \
  227. a->mant[0]++; \
  228. } \
  229. else \
  230. { \
  231. addnum( &a, num_one, BASEX); \
  232. }
  233. #define MSD(x) ((x)->mant[(x)->cdigit-1])
  234. // MULNUM(b) is the rational equivalent of thisterm *= b where thisterm is
  235. // a rational and b is a number, NOTE this is a mixed type operation for
  236. // efficiency reasons.
  237. #define MULNUM(b) mulnumx( &(thisterm->pp), b);
  238. // DIVNUM(b) is the rational equivalent of thisterm /= b where thisterm is
  239. // a rational and b is a number, NOTE this is a mixed type operation for
  240. // efficiency reasons.
  241. #define DIVNUM(b) mulnumx( &(thisterm->pq), b);
  242. // NEXTTERM(p,d) is the rational equivalent of
  243. // thisterm *= p
  244. // d <d is usually an expansion of operations to get thisterm updated.>
  245. // pret += thisterm
  246. #define NEXTTERM(p,d) mulrat(&thisterm,p);d addrat( &pret, thisterm )
  247. // ONEOVER(x) is the rational equivalent of x=1/x
  248. #define ONEOVER(x) {PNUMBER __tmpnum;__tmpnum=x->pp;x->pp=x->pq;x->pq=__tmpnum;}
  249. #ifndef DOS
  250. # if defined(ALTERNATE_ALLOCATION)
  251. //-----------------------------------------------------------------------------
  252. //
  253. // WARNING if you change the allocation package you need to rebuild
  254. // ratpak.lib
  255. //
  256. //-----------------------------------------------------------------------------
  257. extern void *zmalloc( IN unsigned long sze );
  258. extern void zfree( IN double *pd );
  259. # define zstrdup( x ) strcpy( zmalloc( strlen(x)+1 ), x )
  260. # else
  261. # ifdef USE_HEAPALLOC
  262. //
  263. // NT Heap macros. Calling process must create a heap with HeapCreate()
  264. //
  265. # define zmalloc(a) HeapAlloc( hheap, 0, a )
  266. # define zfree(a) HeapFree( hheap, 0, a )
  267. # elif DBG
  268. //
  269. // Debug heap workers
  270. //
  271. HLOCAL MemAllocWorker(LPSTR szFile, int iLine, UINT uFlags, UINT cBytes);
  272. HLOCAL MemFreeWorker(LPSTR szFile, int iLine, HLOCAL hMem);
  273. # define zmalloc(a) MemAllocWorker( __FILE__, __LINE__, LPTR, a )
  274. # define zfree(a) MemFreeWorker( __FILE__, __LINE__, a )
  275. # else
  276. //
  277. // Windows heap macros
  278. //
  279. # define zmalloc(a) LocalAlloc( LPTR, a )
  280. # define zfree(a) LocalFree( a )
  281. # endif
  282. # define zstrdup( x ) strcpy( zmalloc( strlen(x)+1 ), x )
  283. # endif
  284. #endif
  285. //-----------------------------------------------------------------------------
  286. //
  287. // External variables used in the math package.
  288. //
  289. //-----------------------------------------------------------------------------
  290. extern BOOL fhalt; // contains the command to halt execution if true.
  291. extern BOOL fparserror; // set to true if last innum ended in error, else false.
  292. extern NUMOBJ_FMT fmt; // contains the format to use
  293. extern TCHAR szDec[5]; // extern decimal point representation
  294. extern long nRadix; // extern nRadix used for input and output routines
  295. extern unsigned char ftrueinfinite; // set to true to allow infinite precision
  296. // don't use unless you know what you are doing
  297. // used to help decide when to stop calculating.
  298. extern long maxout; // Maximum digits nRadix <nRadix> to use for precision.
  299. // used to help decide when to stop calculating.
  300. extern long ratio; // Internally calculated ratio of internal nRadix
  301. // v.s. nRadix used for input output number routines
  302. extern LPTSTR oom; // Out of memory error message
  303. typedef void ERRFUNC( LPTSTR szErr );
  304. typedef ERRFUNC *LPERRFUNC;
  305. extern LPERRFUNC glpErrFunc; // This function will get called if an error
  306. // occurs inside of ratpak.
  307. #ifndef DOS
  308. extern HANDLE hheap; // hheap is a pointer used in allocation, ratpak.lib
  309. // users responsibility to make sure this is set up
  310. // for use with Heap{Alloc,Free} routines.
  311. #endif
  312. //-----------------------------------------------------------------------------
  313. //
  314. // External functions defined in the math package.
  315. //
  316. //-----------------------------------------------------------------------------
  317. // Call whenever radix changes and at start of program. (Obsolete)
  318. extern void changeRadix( IN long nRadix );
  319. // Call whenever precision changes and at start of program. (Obsolete)
  320. extern void changePrecision( IN long nPrecision );
  321. // Call whenever either nRadix or nPrecision changes, is smarter about
  322. // recalculating constants.
  323. // (Prefered replacement for the ChangeRadix and ChangePrecision calls.)
  324. extern void ChangeConstants( IN long nRadix, IN long nPrecision );
  325. extern BOOL equnum( IN PNUMBER a, IN PNUMBER b ); // returns true of a == b
  326. extern BOOL lessnum( IN PNUMBER a, IN PNUMBER b ); // returns true of a < b
  327. extern BOOL zernum( IN PNUMBER a ); // returns true of a == 0
  328. extern BOOL zerrat( IN PRAT a ); // returns true if a == 0/q
  329. extern TCHAR *putnum( IN OUT PNUMBER *ppnum, IN int fmt );
  330. // returns a text representation of a (*pa)
  331. extern TCHAR *putrat( IN OUT PRAT *pa, IN unsigned long nRadix, IN int fmt );
  332. extern long longpow( IN unsigned long nRadix, IN long power );
  333. extern long numtolong( IN PNUMBER pnum, IN unsigned long nRadix );
  334. extern long rattolong( IN PRAT prat );
  335. extern PNUMBER _createnum( IN long size ); // returns an empty number structure with size digits
  336. extern PNUMBER nRadixxtonum( IN PNUMBER a, IN unsigned long nRadix );
  337. extern PNUMBER binomial( IN long lroot, IN PNUMBER digitnum, IN PNUMBER c, IN PLINKEDLIST pll, IN unsigned long nRadix );
  338. extern PNUMBER gcd( IN PNUMBER a, IN PNUMBER b );
  339. extern PNUMBER innum( IN LPTSTR buffer ); // takes a text representation of a number and returns a number.
  340. // takes a text representation of a number as a mantissa with sign and an exponent with sign.
  341. extern PRAT inrat( IN BOOL fMantIsNeg, IN LPTSTR pszMant, IN BOOL fExpIsNeg, IN LPTSTR pszExp );
  342. extern PNUMBER longfactnum( IN long inlong, IN unsigned long nRadix );
  343. extern PNUMBER longprodnum( IN long start, IN long stop, IN unsigned long nRadix );
  344. extern PNUMBER longtonum( IN long inlong, IN unsigned long nRadix );
  345. extern PNUMBER numtonRadixx( IN PNUMBER a, IN unsigned long nRadix, IN long ratio );
  346. // creates a empty/undefined rational representation (p/q)
  347. extern PRAT _createrat( void );
  348. // returns a new rat structure with the acos of x->p/x->q taking into account
  349. // angle type
  350. extern void acosanglerat( IN OUT PRAT *px, IN ANGLE_TYPE angletype );
  351. // returns a new rat structure with the acosh of x->p/x->q
  352. extern void acoshrat( IN OUT PRAT *px );
  353. // returns a new rat structure with the acos of x->p/x->q
  354. extern void acosrat( IN OUT PRAT *px );
  355. // returns a new rat structure with the asin of x->p/x->q taking into account
  356. // angle type
  357. extern void asinanglerat( IN OUT PRAT *px, IN ANGLE_TYPE angletype );
  358. extern void asinhrat( IN OUT PRAT *px );
  359. // returns a new rat structure with the asinh of x->p/x->q
  360. // returns a new rat structure with the asin of x->p/x->q
  361. extern void asinrat( IN OUT PRAT *px );
  362. // returns a new rat structure with the atan of x->p/x->q taking into account
  363. // angle type
  364. extern void atananglerat( IN OUT PRAT *px, IN ANGLE_TYPE angletype );
  365. // returns a new rat structure with the atanh of x->p/x->q
  366. extern void atanhrat( IN OUT PRAT *px );
  367. // returns a new rat structure with the atan of x->p/x->q
  368. extern void atanrat( IN OUT PRAT *px );
  369. // returns a new rat structure with the atan2 of x->p/x->q, y->p/y->q
  370. extern void atan2rat( IN OUT PRAT *py, IN PRAT y );
  371. // returns a new rat structure with the cosh of x->p/x->q
  372. extern void coshrat( IN OUT PRAT *px );
  373. // returns a new rat structure with the cos of x->p/x->q
  374. extern void cosrat( IN OUT PRAT *px );
  375. // returns a new rat structure with the cos of x->p/x->q taking into account
  376. // angle type
  377. extern void cosanglerat( IN OUT PRAT *px, IN ANGLE_TYPE angletype );
  378. // returns a new rat structure with the exp of x->p/x->q this should not be called explicitly.
  379. extern void _exprat( IN OUT PRAT *px );
  380. // returns a new rat structure with the exp of x->p/x->q
  381. extern void exprat( IN OUT PRAT *px );
  382. // returns a new rat structure with the log base 10 of x->p/x->q
  383. extern void log10rat( IN OUT PRAT *px );
  384. // returns a new rat structure with the natural log of x->p/x->q
  385. extern void lograt( IN OUT PRAT *px );
  386. extern PRAT longtorat( IN long inlong );
  387. extern PRAT numtorat( IN PNUMBER pin, IN unsigned long nRadix );
  388. extern PRAT realtorat( IN double real );
  389. extern void sinhrat( IN OUT PRAT *px );
  390. extern void sinrat( IN OUT PRAT *px );
  391. // returns a new rat structure with the sin of x->p/x->q taking into account
  392. // angle type
  393. extern void sinanglerat( IN OUT PRAT *px, IN ANGLE_TYPE angletype );
  394. extern void tanhrat( IN OUT PRAT *px );
  395. extern void tanrat( IN OUT PRAT *px );
  396. // returns a new rat structure with the tan of x->p/x->q taking into account
  397. // angle type
  398. extern void tananglerat( IN OUT PRAT *px, IN ANGLE_TYPE angletype );
  399. extern void _destroynum( IN PNUMBER pnum );
  400. extern void _destroyrat( IN PRAT prat );
  401. extern void addnum( IN OUT PNUMBER *pa, IN PNUMBER b, unsigned long nRadix );
  402. extern void addrat( IN OUT PRAT *pa, IN PRAT b );
  403. extern void andrat( IN OUT PRAT *pa, IN PRAT b );
  404. extern void const_init( void );
  405. extern void divnum( IN OUT PNUMBER *pa, IN PNUMBER b, IN unsigned long nRadix );
  406. extern void divnumx( IN OUT PNUMBER *pa, IN PNUMBER b );
  407. extern void divrat( IN OUT PRAT *pa, IN PRAT b );
  408. extern void fracrat( IN OUT PRAT *pa );
  409. extern void factrat( IN OUT PRAT *pa );
  410. extern void modrat( IN OUT PRAT *pa, IN PRAT b );
  411. extern void gcdrat( IN OUT PRAT *pa );
  412. extern void intrat( IN OUT PRAT *px);
  413. extern void mulnum( IN OUT PNUMBER *pa, IN PNUMBER b, IN unsigned long nRadix );
  414. extern void mulnumx( IN OUT PNUMBER *pa, IN PNUMBER b );
  415. extern void mulrat( IN OUT PRAT *pa, IN PRAT b );
  416. extern void numpowlong( IN OUT PNUMBER *proot, IN long power, IN unsigned long nRadix );
  417. extern void numpowlongx( IN OUT PNUMBER *proot, IN long power );
  418. extern void orrat( IN OUT PRAT *pa, IN PRAT b );
  419. extern void powrat( IN OUT PRAT *pa, IN PRAT b );
  420. extern void ratpowlong( IN OUT PRAT *proot, IN long power );
  421. extern void remnum( IN OUT PNUMBER *pa, IN PNUMBER b, IN long nRadix );
  422. extern void rootnum( IN OUT PNUMBER *pa, IN PNUMBER b, IN unsigned long nRadix );
  423. extern void rootrat( IN OUT PRAT *pa, IN PRAT b );
  424. extern void scale2pi( IN OUT PRAT *px );
  425. extern void scale( IN OUT PRAT *px, IN PRAT scalefact );
  426. extern void subrat( IN OUT PRAT *pa, IN PRAT b );
  427. extern void xorrat( IN OUT PRAT *pa, IN PRAT b );
  428. extern void lshrat( IN OUT PRAT *pa, IN PRAT b );
  429. extern void rshrat( IN OUT PRAT *pa, IN PRAT b );
  430. extern BOOL rat_equ( IN PRAT a, IN PRAT b );
  431. extern BOOL rat_neq( IN PRAT a, IN PRAT b );
  432. extern BOOL rat_gt( IN PRAT a, IN PRAT b );
  433. extern BOOL rat_ge( IN PRAT a, IN PRAT b );
  434. extern BOOL rat_lt( IN PRAT a, IN PRAT b );
  435. extern BOOL rat_le( IN PRAT a, IN PRAT b );
  436. extern void inbetween( IN PRAT *px, IN PRAT range );
  437. extern DWORDLONG __inline Mul32x32( IN DWORD a, IN DWORD b );
  438. //extern DWORDLONG __inline __fastcall Shr32xbase( IN DWORDLONG a );
  439. extern void factnum( IN OUT PLINKEDLIST *ppllfact, PNUMBER pnum );
  440. extern void trimit( IN OUT PRAT *px );