version 1.1, 2013/12/20 02:02:24 |
version 1.4, 2015/08/07 05:30:36 |
Line 11 void bshiftgz(GZ a,int n,GZ *r); |
|
Line 11 void bshiftgz(GZ a,int n,GZ *r); |
|
|
|
void *gc_realloc(void *p,size_t osize,size_t nsize) |
void *gc_realloc(void *p,size_t osize,size_t nsize) |
{ |
{ |
return (void *)GC_realloc(p,nsize); |
return (void *)Risa_GC_realloc(p,nsize); |
} |
} |
|
|
void gc_free(void *p,size_t size) |
void gc_free(void *p,size_t size) |
{ |
{ |
GC_free(p); |
Risa_GC_free(p); |
} |
} |
|
|
void init_gmpq() |
void init_gmpq() |
{ |
{ |
mp_set_memory_functions(GC_malloc_atomic,gc_realloc,gc_free); |
mp_set_memory_functions(Risa_GC_malloc,gc_realloc,gc_free); |
|
|
mpz_init(ONEMPZ); mpz_set_ui(ONEMPZ,1); MPZTOGZ(ONEMPZ,ONEGZ); |
mpz_init(ONEMPZ); mpz_set_ui(ONEMPZ,1); MPZTOGZ(ONEMPZ,ONEGZ); |
} |
} |
Line 217 void mulgz(GZ n1,GZ n2,GZ *nr) |
|
Line 217 void mulgz(GZ n1,GZ n2,GZ *nr) |
|
else if ( MUNIGZ(n2) ) chsgngz(n1,nr); |
else if ( MUNIGZ(n2) ) chsgngz(n1,nr); |
else { |
else { |
mpz_init(t); mpz_mul(t,BDY(n1),BDY(n2)); MPZTOGZ(t,*nr); |
mpz_init(t); mpz_mul(t,BDY(n1),BDY(n2)); MPZTOGZ(t,*nr); |
|
} |
|
} |
|
|
|
void mul1gz(GZ n1,int n2,GZ *nr) |
|
{ |
|
mpz_t t; |
|
|
|
if ( !n1 || !n2 ) *nr = 0; |
|
else { |
|
mpz_init(t); mpz_mul_ui(t,BDY(n1),(long)n2); MPZTOGZ(t,*nr); |
} |
} |
} |
} |
|
|