version 1.20, 2020/08/26 06:03:31 |
version 1.22, 2020/11/10 04:48:49 |
|
|
/* $OpenXM: OpenXM/src/ox_pari/ox_pari.c,v 1.19 2019/12/19 08:34:41 fujimoto Exp $ */ |
/* $OpenXM: OpenXM/src/ox_pari/ox_pari.c,v 1.21 2020/11/10 01:11:38 noro Exp $ */ |
|
|
#include <signal.h> |
#include <signal.h> |
#include "ox_pari.h" |
#include "ox_pari.h" |
Line 9 static int stack_size = 0; |
|
Line 9 static int stack_size = 0; |
|
static int stack_pointer = 0; |
static int stack_pointer = 0; |
static cmo **stack = NULL; |
static cmo **stack = NULL; |
extern int debug_print; |
extern int debug_print; |
|
extern unsigned long precreal; |
long paristack=10000000; |
long paristack=10000000; |
|
|
#define INIT_S_SIZE 2048 |
#define INIT_S_SIZE 2048 |
Line 157 int sm_executeFunction() |
|
Line 158 int sm_executeFunction() |
|
struct parif *parif; |
struct parif *parif; |
unsigned long prec; |
unsigned long prec; |
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
extern unsigned long precreal; |
|
|
|
cmo_string *func = (cmo_string *)pop(); |
cmo_string *func = (cmo_string *)pop(); |
if(func->tag != CMO_STRING) { |
if(func->tag != CMO_STRING) { |
Line 184 int sm_executeFunction() |
|
Line 184 int sm_executeFunction() |
|
init_pari(); |
init_pari(); |
return 0; |
return 0; |
} |
} |
|
if ( !strcmp(func->s,"pari_setprec") ) { |
|
long n,prec; |
|
|
|
n = cmo_to_int(av[0]); |
|
setrealprecision(n,&prec); |
|
return 0; |
|
} |
parif =search_parif(func->s); |
parif =search_parif(func->s); |
if ( !parif ) { |
if ( !parif ) { |
sprintf(buf,"%s : not implemented",func->s); |
sprintf(buf,"%s : not implemented",func->s); |
Line 196 int sm_executeFunction() |
|
Line 203 int sm_executeFunction() |
|
|
|
av0 = avma; |
av0 = avma; |
z = cmo_to_GEN(av[0]); |
z = cmo_to_GEN(av[0]); |
prec = ac==2 ? cmo_to_int(av[1])*3.32193/32+3 : precreal; |
prec = ac==2 ? ndec2prec(cmo_to_int(av[1])) : nbits2prec(precreal); |
if ( ismatrix(z) ) { |
if ( ismatrix(z) ) { |
int i,len; |
int i,len; |
len = lg(z); |
len = lg(z); |