Files correlati :gfm.dll Ricompilazione Demo : [ ] Commento :riportate sulla 2.1 le correzioni sulla gfm.dll della 2.0 git-svn-id: svn://10.65.10.50/trunk@11815 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			51 lines
		
	
	
		
			1020 B
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1020 B
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
| /* int _DivUnsArrByPwrOf10(a,n,p)
 | |
|  *
 | |
|  * ARGUMENT
 | |
|  *      unsigned        a[];
 | |
|  *      int             p;            power of 10 to divide by
 | |
|  *      int             n;            number of digits
 | |
|  *
 | |
|  * DESCRIPTION
 | |
|  *      Divides a number of n words (a) by a power of 10, c= a/10^p,
 | |
|  *  a>=0, p>0, truncating the result, c is correct only if a/10^p<2^79.
 | |
|  *
 | |
|  * SIDE EFFECTS
 | |
|  *      The value of a is destroyed.
 | |
|  *
 | |
|  * RETURNS
 | |
|  *      None. (always succeeds)
 | |
|  *
 | |
|  * AUTHOR
 | |
|  *      Brugnoli Giugno 1992
 | |
|  *
 | |
|  * MODIFICATIONS
 | |
|  *
 | |
|  */
 | |
| 
 | |
| #include <stdio.h>
 | |
| #include <math.h>
 | |
| #include "gm.h"
 | |
| #include "gmsystem.h"
 | |
| 
 | |
| extern double pow(double, double);
 | |
| 
 | |
| 
 | |
| void    _DivUnsArrByPwrOf10Trunc(unsigned  SHORT a[],int n,int p)
 | |
| {
 | |
|   while (p>4)
 | |
|   {
 | |
|     _DivUnsArrByUns(a,10000,n);
 | |
|     p-=4;
 | |
|   }
 | |
| 
 | |
|   case (p)
 | |
|   {
 | |
|   case 0: _DivUnsArrByUns(a,1,n); break;
 | |
|   case 1: _DivUnsArrByUns(a,10,n); break;
 | |
|   case 2: _DivUnsArrByUns(a,100,n); break;
 | |
|   case 3: _DivUnsArrByUns(a,1000,n); break;
 | |
|   case 4: _DivUnsArrByUns(a,10000,n); break;
 | |
|   default:
 | |
|   }
 | |
| }
 |