* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)mult.c 5.1 (Berkeley) %G%";
mult(a
,b
,c
) struct mint
*a
,*b
,*c
;
if(x
.len
<y
.len
) m_mult(&y
,&x
,&z
);
if(sign
<0) c
->len
= -z
.len
;
if(c
->len
==0) shfree(z
.val
);
#define S3 x=x*b->val[i-j];
#define S4 tradd(&carry,&sum,x);
#define S5 c->val[i]=sum.yy.low&077777;
#define S6 sum.xx=sum.xx>>15;
#define S7 sum.yy.high=carry;
m_mult(a
,b
,c
) struct mint
*a
,*b
,*c
;
union {long xx
; struct half yy
;} sum
;
c
->val
=xalloc(a
->len
+b
->len
,"m_mult");
for(j
=i
-b
->len
+1;j
<i
+1;j
++)
for(;i
<a
->len
+b
->len
;i
++)
for(j
=i
-b
->len
+1;j
<a
->len
;j
++)
else c
->len
=a
->len
+b
->len
-1;
tradd(a
,b
,c
) long c
; int *a
; union g
{long xx
; struct half yy
;} *b
;
{ b
->yy
.high
= b
->yy
.high
&077777;