ba237a9d91
Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunti i sorgenti per Greenleaf Math Library (gfm.dll) git-svn-id: svn://10.65.10.50/trunk@10079 c028cbd2-c16b-5b4b-a496-9718f37d4682
54 lines
1.0 KiB
C
Executable File
54 lines
1.0 KiB
C
Executable File
/* void _DivUns10ArrByUns5ArrTrn(c, a, b)
|
|
*
|
|
* ARGUMENT
|
|
* unsigned c[], a[], b[];
|
|
*
|
|
* DESCRIPTION
|
|
* Divides a 10-word by a 5-word, giving a 5-word, setting c = a / b.
|
|
* This functions assumes that b > 0 and a / b < 2^79, and will break if
|
|
* those conditions are not true. The result is always truncated.
|
|
* It calls dmbyn.
|
|
*
|
|
* SIDE EFFECTS
|
|
* a and b may be destroyed, but they are not needed later on.
|
|
*
|
|
* RETURNS
|
|
* None.
|
|
*
|
|
* AUTHOR
|
|
* Jared Levy Aug 5, 1987
|
|
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
|
|
*
|
|
* MODIFICATIONS
|
|
*
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include "gm.h"
|
|
#include "gmsystem.h"
|
|
|
|
void _DivUns10ArrByUns5ArrTrn(c, a, b)
|
|
unsigned SHORT c[], a[], b[];
|
|
{
|
|
register int m, n;
|
|
|
|
n = 4;
|
|
while (b[n] == 0 && n>0)
|
|
n--;
|
|
|
|
if (n == 0) { /* dividing by a 1 digit number */
|
|
(void) _DivUnsArrByUns(a, b[0], 6);
|
|
for (m=0; m<5; m++)
|
|
c[m]=a[m];
|
|
}
|
|
|
|
else {
|
|
/* dividing by a multi digit number */
|
|
m = 9;
|
|
while (a[m] == 0 && m>0)
|
|
m--;
|
|
|
|
_DivUnsArrByUnsArr(c, a, m+1, b, n+1, 0);
|
|
}
|
|
}
|