|
|
| version 1.1.1.1, 2025/01/19 02:04:04 | version 1.2, 2025/02/28 20:06:07 |
|---|---|
| Line 61 extern void cond_round (char *a, int dig | Line 61 extern void cond_round (char *a, int dig |
| #define NUMBASE 10 | #define NUMBASE 10 |
| short int | short int |
| pattern (a, b) /* evaluates a ? b */ | pattern (char *a, char *b) /* evaluates a ? b */ |
| char *a; | |
| char *b; | |
| { | { |
| short levels; /* depth of stack */ | short levels; /* depth of stack */ |
| register int patx; /* match stack pointer */ | register int patx; /* match stack pointer */ |
| Line 486 pattern (a, b) /* evaluates a ? b */ | Line 483 pattern (a, b) /* evaluates a ? b */ |
| } | } |
| return '0'; | return '0'; |
| } /* end of pattern */ | } /* end of pattern */ |
| /******************************************************************************/ | |
| void | |
| pminmax (str, min, max) /* auxiliary function for grouped pattern match */ | |
| /* determines */ | |
| char *str; /* of a pattern 'str' */ | |
| int *min, | |
| *max; /* the minimum and maximum possible length */ | |
| /******************************************************************************/ | |
| void pminmax (char *str, int *min, int *max) | |
| { | { |
| int mininc, | int mininc, |
| maxinc, | maxinc, |
| Line 592 pminmax (str, min, max) /* auxiliary f | Line 583 pminmax (str, min, max) /* auxiliary f |
| return; | return; |
| } /* end pminmax() */ | } /* end pminmax() */ |
| /******************************************************************************/ | /******************************************************************************/ |
| void | void add (char *a, char *b) /* string arithmetic a+=b; */ |
| add (a, b) /* string arithmetic a+=b; */ | |
| char *a, | |
| *b; | |
| { | { |
| if (b[0] == ZERO) | if (b[0] == ZERO) |
| Line 853 add (a, b) /* string arithmetic a+=b; | Line 840 add (a, b) /* string arithmetic a+=b; |
| } | } |
| } | } |
| /******************************************************************************/ | /******************************************************************************/ |
| void | void mul (char *a, char *b) /* string arithmetic a=a*b */ |
| mul (a, b) /* string arithmetic a=a*b */ | |
| char *a, | |
| *b; | |
| { | { |
| char c[2*(STRLEN+1) /*was 512*/]; | char c[2*(STRLEN+1) /*was 512*/]; |
| short alen, | short alen, |
| Line 1101 mul (a, b) /* string arithmetic a=a*b | Line 1085 mul (a, b) /* string arithmetic a=a*b |
| * for a detailed description of the method for the divisions see * | * for a detailed description of the method for the divisions see * |
| * donald e.knuth 'the art of computer programming' vol.2 p.257 * | * donald e.knuth 'the art of computer programming' vol.2 p.257 * |
| ******************************************************************************/ | ******************************************************************************/ |
| void | void mdiv (char *uu, char *v, short typ) /* divide string arithmetic */ |
| mdiv (uu, v, typ) /* divide string arithmetic */ | |
| char *uu, /* dividend and result */ | |
| *v; /* divisor */ | |
| short typ; /* type: '/' or '\' or '#' */ | |
| { | { |
| char q[STRLEN + 2 /*was 257*/]; /* quotient */ | char q[STRLEN + 2 /*was 257*/]; /* quotient */ |
| char u[2*(STRLEN + 1)/*was 512*/];/* intermediate result */ | char u[2*(STRLEN + 1)/*was 512*/];/* intermediate result */ |
| Line 1551 mdiv (uu, v, typ) /* divide string ari | Line 1530 mdiv (uu, v, typ) /* divide string ari |
| return; | return; |
| } /* end div() */ | } /* end div() */ |
| /******************************************************************************/ | /******************************************************************************/ |
| void | void power (char *a, char *b) /* raise a to the b-th power */ |
| power (a, b) /* raise a to the b-th power */ | |
| char *a, | |
| *b; | |
| { | { |
| char c[STRLEN + 2/*was 257*/]; | char c[STRLEN + 2/*was 257*/]; |
| char d[4*(STRLEN + 1)/*was 1024*/];/* 257 should be sufficient, but somewhere there */ | char d[4*(STRLEN + 1)/*was 1024*/];/* 257 should be sufficient, but somewhere there */ |
| Line 1767 power (a, b) /* raise a to the b-th p | Line 1743 power (a, b) /* raise a to the b-th p |
| return; | return; |
| } /* end power() */ | } /* end power() */ |
| /******************************************************************************/ | /******************************************************************************/ |
| void | void g_sqrt (char *a) /* square root */ |
| g_sqrt (a) /* square root */ | |
| char *a; | |
| { | { |
| register int i, | register int i, |
| ch; | ch; |
| Line 1822 g_sqrt (a) /* square root */ | Line 1795 g_sqrt (a) /* square root */ |
| } | } |
| } /* end g_sqrt() */ | } /* end g_sqrt() */ |
| /******************************************************************************/ | /******************************************************************************/ |
| void | void root (char *a, long n) /* n.th root */ |
| root (a, n) /* n.th root */ | |
| char *a; | |
| long n; | |
| { | { |
| register int i, | register int i, |
| ch; | ch; |
| Line 1917 root (a, n) /* n.th root */ | Line 1886 root (a, n) /* n.th root */ |
| } | } |
| } /* end root() */ | } /* end root() */ |
| /******************************************************************************/ | /******************************************************************************/ |
| int | int numlit (char *str) |
| numlit (str) | |
| /** str is interpreted as a MUMPS number | |
| * and is converted to canonical form | |
| * return value: 1=EUR, 4=DM, 0=other */ | |
| char *str; | |
| { | { |
| long j, | long j, |
| mi = 0, | mi = 0, |
| Line 2154 int unit (char *str) | Line 2118 int unit (char *str) |
| return 0; | return 0; |
| } | } |
| /******************************************************************************/ | /******************************************************************************/ |
| long | long intexpr (char *str) |
| intexpr (str) | |
| char *str; | |
| /* 'str' is interpreted as integer and converted to int */ | |
| { | { |
| { | { |
| register int ch; | register int ch; |
| Line 2228 intexpr (str) | Line 2188 intexpr (str) |
| } | } |
| } /* end of intexpr */ | } /* end of intexpr */ |
| /******************************************************************************/ | /******************************************************************************/ |
| short int | short int tvexpr (char *str) /* str is interpreted as truth valued expression */ |
| tvexpr (str) /* str is interpreted as truth valued expression */ | |
| char *str; | |
| { | { |
| if (str[0] > ZERO && str[0] <= NINE) { | if (str[0] > ZERO && str[0] <= NINE) { |
| str[0] = ONE; | str[0] = ONE; |
| Line 2270 tvexpr (str) /* str is interpreted as | Line 2228 tvexpr (str) /* str is interpreted as |
| } | } |
| } | } |
| } | } |
| /******************************************************************************/ | /******************************************************************************/ |
| void | void m_op (char *a, char *b, short op) |
| m_op (a, b, op) | |
| char *a, | |
| *b; | |
| short op; | |
| { | { |
| int atyp, | int atyp, |
| btyp; /* DM/EUR currency types */ | btyp; /* DM/EUR currency types */ |