[Ecls-list] computing results into preallocated bignums
Nils Bruin
nbruin at cecm.sfu.ca
Tue Sep 8 23:36:13 UTC 2009
On Tue, 8 Sep 2009, Nils Bruin wrote:
> ------------------------------------------------------------------------------
> NEW CODE in ecl_plus:
> ------------------------------------------------------------------------------
> case t_bignum:
> i = x->big.big_size;
> if (i < 0) i = -i;
> j = y->big.big_size;
> if (j < 0) j = -j;
> if (i > j ) dim = (i+1); else dim = (j+1);
> z = ecl_alloc_compact_object(t_bignum, (cl_index) (dim*sizeof(mp_limb_t)));
> z->big.big_limbs = ECL_COMPACT_OBJECT_EXTRA(z);
> z->big.big_size = 0;
> z->big.big_dim = dim;
> _ecl_big_add(z, x, y);
> ------------------------------------------------------------------------------
My apologies. I mispasted. The code I tried did have the required
"return z;" after that.
More information about the ecl-devel
mailing list