\f
SCM_PROC(s_exact_p, "exact?", 1, 0, 0, scm_exact_p);
-#ifdef __STDC__
-SCM
-scm_exact_p(SCM x)
-#else
+
SCM
scm_exact_p(x)
SCM x;
-#endif
{
if SCM_INUMP(x) return SCM_BOOL_T;
#ifdef SCM_BIGDIG
}
SCM_PROC(s_odd_p, "odd?", 1, 0, 0, scm_odd_p);
-#ifdef __STDC__
-SCM
-scm_odd_p(SCM n)
-#else
+
SCM
scm_odd_p(n)
SCM n;
-#endif
{
#ifdef SCM_BIGDIG
if SCM_NINUMP(n) {
}
SCM_PROC(s_even_p, "even?", 1, 0, 0, scm_even_p);
-#ifdef __STDC__
-SCM
-scm_even_p(SCM n)
-#else
+
SCM
scm_even_p(n)
SCM n;
-#endif
{
#ifdef SCM_BIGDIG
if SCM_NINUMP(n) {
}
SCM_PROC(s_abs, "abs", 1, 0, 0, scm_abs);
-#ifdef __STDC__
-SCM
-scm_abs(SCM x)
-#else
+
SCM
scm_abs(x)
SCM x;
-#endif
{
#ifdef SCM_BIGDIG
if SCM_NINUMP(x) {
}
SCM_PROC(s_quotient, "quotient", 2, 0, 0, scm_quotient);
-#ifdef __STDC__
-SCM
-scm_quotient(SCM x, SCM y)
-#else
+
SCM
scm_quotient(x, y)
SCM x;
SCM y;
-#endif
{
register long z;
#ifdef SCM_BIGDIG
}
SCM_PROC(s_remainder, "remainder", 2, 0, 0, scm_remainder);
-#ifdef __STDC__
-SCM
-scm_remainder(SCM x, SCM y)
-#else
+
SCM
scm_remainder(x, y)
SCM x;
SCM y;
-#endif
{
register long z;
#ifdef SCM_BIGDIG
}
SCM_PROC(s_modulo, "modulo", 2, 0, 0, scm_modulo);
-#ifdef __STDC__
-SCM
-scm_modulo(SCM x, SCM y)
-#else
+
SCM
scm_modulo(x, y)
SCM x;
SCM y;
-#endif
{
register long yy, z;
#ifdef SCM_BIGDIG
}
SCM_PROC1 (s_gcd, "gcd", scm_tc7_asubr, scm_gcd);
-#ifdef __STDC__
-SCM
-scm_gcd(SCM x, SCM y)
-#else
+
SCM
scm_gcd(x, y)
SCM x;
SCM y;
-#endif
{
register long u, v, k, t;
if SCM_UNBNDP(y) return SCM_UNBNDP(x) ? SCM_INUM0 : x;
}
SCM_PROC1 (s_lcm, "lcm", scm_tc7_asubr, scm_lcm);
-#ifdef __STDC__
-SCM
-scm_lcm(SCM n1, SCM n2)
-#else
+
SCM
scm_lcm(n1, n2)
SCM n1;
SCM n2;
-#endif
{
SCM d;
if SCM_UNBNDP(n2) {
#ifndef scm_long2num
SCM_PROC1 (s_logand, "logand", scm_tc7_asubr, scm_logand);
-#ifdef __STDC__
-SCM
-scm_logand(SCM n1, SCM n2)
-#else
+
SCM
scm_logand(n1, n2)
SCM n1;
SCM n2;
-#endif
{
return scm_long2num(scm_num2long(n1, (char *)SCM_ARG1, s_logand)
& scm_num2long(n2, (char *)SCM_ARG2, s_logand));
}
SCM_PROC1 (s_logior, "logior", scm_tc7_asubr, scm_logior);
-#ifdef __STDC__
-SCM
-scm_logior(SCM n1, SCM n2)
-#else
+
SCM
scm_logior(n1, n2)
SCM n1;
SCM n2;
-#endif
{
return scm_long2num(scm_num2long(n1, (char *)SCM_ARG1, s_logior)
| scm_num2long(n2, (char *)SCM_ARG2, s_logior));
}
SCM_PROC1 (s_logxor, "logxor", scm_tc7_asubr, scm_logxor);
-#ifdef __STDC__
-SCM
-scm_logxor(SCM n1, SCM n2)
-#else
+
SCM
scm_logxor(n1, n2)
SCM n1;
SCM n2;
-#endif
{
return scm_long2num(scm_num2long(n1, (char *)SCM_ARG1, s_logxor)
^ scm_num2long(n2, (char *)SCM_ARG2, s_logxor));
}
SCM_PROC(s_logtest, "logtest", 2, 0, 0, scm_logtest);
-#ifdef __STDC__
-SCM
-scm_logtest(SCM n1, SCM n2)
-#else
+
SCM
scm_logtest(n1, n2)
SCM n1;
SCM n2;
-#endif
{
return ((scm_num2long (n1, (char *)SCM_ARG1, s_logtest)
& scm_num2long (n2, (char *)SCM_ARG2, s_logtest))
SCM_PROC(s_logbit_p, "logbit?", 2, 0, 0, scm_logbit_p);
-#ifdef __STDC__
-SCM
-scm_logbit_p(SCM n1, SCM n2)
-#else
+
SCM
scm_logbit_p(n1, n2)
SCM n1;
SCM n2;
-#endif
{
return (((1 << scm_num2long (n1, (char *)SCM_ARG1, s_logtest))
& scm_num2long (n2, (char *)SCM_ARG2, s_logtest))
#else
SCM_PROC1 (s_logand, "logand", scm_tc7_asubr, scm_logand);
-#ifdef __STDC__
-SCM
-scm_logand(SCM n1, SCM n2)
-#else
+
SCM
scm_logand(n1, n2)
SCM n1;
SCM n2;
-#endif
{
SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logand);
SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logand);
}
SCM_PROC1 (s_logior, "logior", scm_tc7_asubr, scm_logior);
-#ifdef __STDC__
-SCM
-scm_logior(SCM n1, SCM n2)
-#else
+
SCM
scm_logior(n1, n2)
SCM n1;
SCM n2;
-#endif
{
SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logior);
SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logior);
}
SCM_PROC1 (s_logxor, "logxor", scm_tc7_asubr, scm_logxor);
-#ifdef __STDC__
-SCM
-scm_logxor(SCM n1, SCM n2)
-#else
+
SCM
scm_logxor(n1, n2)
SCM n1;
SCM n2;
-#endif
{
SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logxor);
SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logxor);
}
SCM_PROC(s_logtest, "logtest", 2, 0, 0, scm_logtest);
-#ifdef __STDC__
-SCM
-scm_logtest(SCM n1, SCM n2)
-#else
+
SCM
scm_logtest(n1, n2)
SCM n1;
SCM n2;
-#endif
{
SCM_ASSERT(SCM_INUMP(n1), n1, SCM_ARG1, s_logtest);
SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logtest);
}
SCM_PROC(s_logbit_p, "logbit?", 2, 0, 0, scm_logbit_p);
-#ifdef __STDC__
-SCM
-scm_logbit_p(SCM n1, SCM n2)
-#else
+
SCM
scm_logbit_p(n1, n2)
SCM n1;
SCM n2;
-#endif
{
SCM_ASSERT(SCM_INUMP(n1) && SCM_INUM(n1) >= 0, n1, SCM_ARG1, s_logbit_p);
SCM_ASSERT(SCM_INUMP(n2), n2, SCM_ARG2, s_logbit_p);
#endif
SCM_PROC(s_lognot, "lognot", 1, 0, 0, scm_lognot);
-#ifdef __STDC__
-SCM
-scm_lognot(SCM n)
-#else
+
SCM
scm_lognot(n)
SCM n;
-#endif
{
SCM_ASSERT(SCM_INUMP(n), n, SCM_ARG1, s_lognot);
return scm_difference(SCM_MAKINUM(-1L), n);
}
SCM_PROC(s_integer_expt, "integer-expt", 2, 0, 0, scm_integer_expt);
-#ifdef __STDC__
-SCM
-scm_integer_expt(SCM z1, SCM z2)
-#else
+
SCM
scm_integer_expt(z1, z2)
SCM z1;
SCM z2;
-#endif
{
SCM acc = SCM_MAKINUM(1L);
#ifdef SCM_BIGDIG
}
SCM_PROC(s_ash, "ash", 2, 0, 0, scm_ash);
-#ifdef __STDC__
-SCM
-scm_ash(SCM n, SCM cnt)
-#else
+
SCM
scm_ash(n, cnt)
SCM n;
SCM cnt;
-#endif
{
SCM res = SCM_INUM(n);
SCM_ASSERT(SCM_INUMP(cnt), cnt, SCM_ARG2, s_ash);
}
SCM_PROC(s_bit_extract, "bit-extract", 3, 0, 0, scm_bit_extract);
-#ifdef __STDC__
-SCM
-scm_bit_extract(SCM n, SCM start, SCM end)
-#else
+
SCM
scm_bit_extract(n, start, end)
SCM n;
SCM start;
SCM end;
-#endif
{
SCM_ASSERT(SCM_INUMP(start), start, SCM_ARG2, s_bit_extract);
SCM_ASSERT(SCM_INUMP(end), end, SCM_ARG3, s_bit_extract);
char scm_logtab[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
SCM_PROC(s_logcount, "logcount", 1, 0, 0, scm_logcount);
-#ifdef __STDC__
-SCM
-scm_logcount (SCM n)
-#else
+
SCM
scm_logcount(n)
SCM n;
-#endif
{
register unsigned long c = 0;
register long nn;
char scm_ilentab[] = {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4};
SCM_PROC(s_integer_length, "integer-length", 1, 0, 0, scm_integer_length);
-#ifdef __STDC__
-SCM
-scm_integer_length(SCM n)
-#else
+
SCM
scm_integer_length(n)
SCM n;
-#endif
{
register unsigned long c = 0;
register long nn;
#ifdef SCM_BIGDIG
char s_bignum[] = "bignum";
-#ifdef __STDC__
-SCM
-scm_mkbig(scm_sizet nlen, int sign)
-#else
+
SCM
scm_mkbig(nlen, sign)
scm_sizet nlen;
int sign;
-#endif
{
SCM v = nlen;
if (((v << 16) >> 16) != nlen)
return v;
}
-#ifdef __STDC__
-SCM
-scm_big2inum(SCM b, scm_sizet l)
-#else
+
SCM
scm_big2inum(b, l)
SCM b;
scm_sizet l;
-#endif
{
unsigned long num = 0;
SCM_BIGDIG *tmp = SCM_BDIGITS(b);
char s_adjbig[] = "scm_adjbig";
-#ifdef __STDC__
-SCM
-scm_adjbig(SCM b, scm_sizet nlen)
-#else
+
SCM
scm_adjbig(b, nlen)
SCM b;
scm_sizet nlen;
-#endif
{
long nsiz = nlen;
if (((nsiz << 16) >> 16) != nlen) scm_wta(SCM_MAKINUM(nsiz), (char *)SCM_NALLOC, s_adjbig);
}
-#ifdef __STDC__
-SCM
-scm_normbig(SCM b)
-#else
+
SCM
scm_normbig(b)
SCM b;
-#endif
{
#ifndef _UNICOS
scm_sizet nlen = SCM_NUMDIGS(b);
}
-#ifdef __STDC__
-SCM
-scm_copybig(SCM b, int sign)
-#else
+
SCM
scm_copybig(b, sign)
SCM b;
int sign;
-#endif
{
scm_sizet i = SCM_NUMDIGS(b);
SCM ans = scm_mkbig(i, sign);
}
-#ifdef __STDC__
-SCM
-scm_long2big(long n)
-#else
+
SCM
scm_long2big(n)
long n;
-#endif
{
scm_sizet i = 0;
SCM_BIGDIG *digits;
}
#ifdef LONGLONGS
-#ifdef __STDC__
-SCM
-scm_long_long2big(long_long n)
-#else
+
SCM
scm_long_long2big(n)
long_long n;
-#endif
{
scm_sizet i;
SCM_BIGDIG *digits;
}
#endif
-#ifdef __STDC__
-SCM
-scm_2ulong2big(unsigned long * np)
-#else
+
SCM
scm_2ulong2big(np)
unsigned long * np;
-#endif
{
unsigned long n;
scm_sizet i;
}
-#ifdef __STDC__
-SCM
-scm_ulong2big(unsigned long n)
-#else
+
SCM
scm_ulong2big(n)
unsigned long n;
-#endif
{
scm_sizet i = 0;
SCM_BIGDIG *digits;
}
-#ifdef __STDC__
-int
-scm_bigcomp(SCM x, SCM y)
-#else
+
int
scm_bigcomp(x, y)
SCM x;
SCM y;
-#endif
{
int xsign = SCM_BIGSIGN(x);
int ysign = SCM_BIGSIGN(y);
#ifndef SCM_DIGSTOOBIG
-#ifdef __STDC__
-long
-scm_pseudolong(long x)
-#else
+
long
scm_pseudolong(x)
long x;
-#endif
{
union {
long l;
#else
-#ifdef __STDC__
-void
-scm_longdigs(long x, SCM_BIGDIG digs[])
-#else
+
void
scm_longdigs(x, digs)
long x;
SCM_BIGDIG digs[];
-#endif
{
scm_sizet i = 0;
if (x < 0) x = -x;
#endif
-#ifdef __STDC__
-SCM
-scm_addbig(SCM_BIGDIG *x, scm_sizet nx, int xsgn, SCM bigy, int sgny)
-#else
+
SCM
scm_addbig(x, nx, xsgn, bigy, sgny)
SCM_BIGDIG *x;
int xsgn;
SCM bigy;
int sgny;
-#endif
{
/* Assumes nx <= SCM_NUMDIGS(bigy) */
/* Assumes xsgn and sgny scm_equal either 0 or 0x0100 */
return scm_normbig(z);
}
-#ifdef __STDC__
-SCM
-scm_mulbig(SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn)
-#else
+
SCM
scm_mulbig(x, nx, y, ny, sgn)
SCM_BIGDIG *x;
SCM_BIGDIG *y;
scm_sizet ny;
int sgn;
-#endif
{
scm_sizet i = 0, j = nx + ny;
unsigned long n = 0;
return scm_normbig(z);
}
-#ifdef __STDC__
-unsigned int
-scm_divbigdig(SCM_BIGDIG *ds, scm_sizet h, SCM_BIGDIG div)
-#else
+
unsigned int
scm_divbigdig(ds, h, div)
SCM_BIGDIG *ds;
scm_sizet h;
SCM_BIGDIG div;
-#endif
{
register unsigned long t2 = 0;
while(h--) {
}
-#ifdef __STDC__
-SCM
-scm_divbigint(SCM x, long z, int sgn, int mode)
-#else
+
SCM
scm_divbigint(x, z, sgn, mode)
SCM x;
long z;
int sgn;
int mode;
-#endif
{
if (z < 0) z = -z;
if (z < SCM_BIGRAD) {
}
}
-#ifdef __STDC__
-SCM
-scm_divbigbig(SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn, int modes)
-#else
+
SCM
scm_divbigbig(x, nx, y, ny, sgn, modes)
SCM_BIGDIG *x;
scm_sizet ny;
int sgn;
int modes;
-#endif
{
/* modes description
0 remainder
-#ifdef __STDC__
-static scm_sizet
-idbl2str(double f, char *a)
-#else
+
+static scm_sizet idbl2str SCM_P ((double f, char *a));
+
static scm_sizet
idbl2str(f, a)
double f;
char *a;
-#endif
{
int efmt, dpt, d, i, wp = scm_dblprec;
scm_sizet ch = 0;
return ch;
}
-#ifdef __STDC__
-static scm_sizet
-iflo2str(SCM flt, char *str)
-#else
+
+static scm_sizet iflo2str SCM_P ((SCM flt, char *str));
+
static scm_sizet
iflo2str(flt, str)
SCM flt;
char *str;
-#endif
{
scm_sizet i;
# ifdef SCM_SINGLES
}
#endif /* SCM_FLOATS */
-#ifdef __STDC__
-scm_sizet
-scm_iint2str(long num, int rad, char *p)
-#else
+
scm_sizet
scm_iint2str(num, rad, p)
long num;
int rad;
char *p;
-#endif
{
scm_sizet j;
register int i = 1, d;
#ifdef SCM_BIGDIG
-#ifdef __STDC__
-static SCM
-big2str(SCM b, register unsigned int radix)
-#else
+
+static SCM big2str SCM_P ((SCM b, register unsigned int radix));
+
static SCM
big2str(b, radix)
SCM b;
register unsigned int radix;
-#endif
{
SCM t = scm_copybig(b, 0); /* sign of temp doesn't matter */
register SCM_BIGDIG *ds = SCM_BDIGITS(t);
SCM_PROC(s_number_to_string, "number->string", 1, 1, 0, scm_number_to_string);
-#ifdef __STDC__
-SCM
-scm_number_to_string(SCM x, SCM radix)
-#else
+
SCM
scm_number_to_string(x, radix)
SCM x;
SCM radix;
-#endif
{
if SCM_UNBNDP(radix) radix=SCM_MAKINUM(10L);
else SCM_ASSERT(SCM_INUMP(radix), radix, SCM_ARG2, s_number_to_string);
/* These print routines are stubbed here so that scm_repl.c doesn't need
SCM_FLOATS or SCM_BIGDIGs conditionals */
-#ifdef __STDC__
-int
-scm_floprint(SCM sexp, SCM port, scm_print_state *pstate)
-#else
+
int
scm_floprint(sexp, port, pstate)
SCM sexp;
SCM port;
scm_print_state *pstate;
-#endif
{
#ifdef SCM_FLOATS
char num_buf[SCM_FLOBUFLEN];
}
-#ifdef __STDC__
-int
-scm_bigprint(SCM exp, SCM port, scm_print_state *pstate)
-#else
+
int
scm_bigprint(exp, port, pstate)
SCM exp;
SCM port;
scm_print_state *pstate;
-#endif
{
#ifdef SCM_BIGDIG
exp = big2str(exp, (unsigned int)10);
/*** STRINGS -> NUMBERS ***/
+static SCM scm_small_istr2int SCM_P ((char *str, long len, long radix));
+
static SCM
scm_small_istr2int(str, len, radix)
char *str;
}
-#ifdef __STDC__
-SCM
-scm_istr2int(char *str, long len, long radix)
-#else
+
SCM
scm_istr2int(str, len, radix)
char *str;
long len;
long radix;
-#endif
{
scm_sizet j;
register scm_sizet k, blen = 1;
}
#ifdef SCM_FLOATS
-#ifdef __STDC__
-SCM
-scm_istr2flo(char *str, long len, long radix)
-#else
+
SCM
scm_istr2flo(str, len, radix)
char *str;
long len;
long radix;
-#endif
{
register int c, i = 0;
double lead_sgn;
#endif /* SCM_FLOATS */
-#ifdef __STDC__
-SCM
-scm_istring2number(char *str, long len, long radix)
-#else
+
SCM
scm_istring2number(str, len, radix)
char *str;
long len;
long radix;
-#endif
{
int i = 0;
char ex = 0;
SCM_PROC(s_string_to_number, "string->number", 1, 1, 0, scm_string_to_number);
-#ifdef __STDC__
-SCM
-scm_string_to_number(SCM str, SCM radix)
-#else
+
SCM
scm_string_to_number(str, radix)
SCM str;
SCM radix;
-#endif
{
SCM answer;
if SCM_UNBNDP(radix) radix=SCM_MAKINUM(10L);
/*** END strs->nums ***/
#ifdef SCM_FLOATS
-#ifdef __STDC__
-SCM
-scm_makdbl (double x, double y)
-#else
+
SCM
scm_makdbl (x, y)
double x;
double y;
-#endif
{
SCM z;
if ((y==0.0) && (x==0.0)) return scm_flo0;
#endif
-#ifdef __STDC__
-SCM
-scm_bigequal(SCM x, SCM y)
-#else
+
SCM
scm_bigequal(x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_BIGDIG
if (0==scm_bigcomp(x, y)) return SCM_BOOL_T;
}
-#ifdef __STDC__
-SCM
-scm_floequal(SCM x, SCM y)
-#else
+
SCM
scm_floequal(x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_FLOATS
if (SCM_REALPART(x) != SCM_REALPART(y)) return SCM_BOOL_F;
SCM_PROC(s_number_p, "number?", 1, 0, 0, scm_number_p);
SCM_PROC(s_complex_p, "complex?", 1, 0, 0, scm_number_p);
-#ifdef __STDC__
-SCM
-scm_number_p(SCM x)
-#else
+
SCM
scm_number_p(x)
SCM x;
-#endif
{
if SCM_INUMP(x) return SCM_BOOL_T;
#ifdef SCM_FLOATS
#ifdef SCM_FLOATS
SCM_PROC(s_real_p, "real?", 1, 0, 0, scm_real_p);
SCM_PROC(s_rational_p, "rational?", 1, 0, 0, scm_real_p);
-#ifdef __STDC__
-SCM
-scm_real_p(SCM x)
-#else
+
SCM
scm_real_p(x)
SCM x;
-#endif
{
if (SCM_INUMP(x))
return SCM_BOOL_T;
SCM_PROC(s_int_p, "int?", 1, 0, 0, scm_int_p);
-#ifdef __STDC__
-SCM
-scm_int_p(SCM x)
-#else
+
SCM
scm_int_p(x)
SCM x;
-#endif
{
double r;
if SCM_INUMP(x) return SCM_BOOL_T;
#endif /* SCM_FLOATS */
SCM_PROC(s_inexact_p, "inexact?", 1, 0, 0, scm_inexact_p);
-#ifdef __STDC__
-SCM
-scm_inexact_p(SCM x)
-#else
+
SCM
scm_inexact_p(x)
SCM x;
-#endif
{
#ifdef SCM_FLOATS
if (SCM_NIMP(x) && SCM_INEXP(x)) return SCM_BOOL_T;
SCM_PROC1 (s_eq_p, "=?", scm_tc7_rpsubr, scm_num_eq_p);
-#ifdef __STDC__
-SCM
-scm_num_eq_p (SCM x, SCM y)
-#else
+
SCM
scm_num_eq_p (x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_FLOATS
SCM t;
SCM_PROC1 (s_less_p, "<?", scm_tc7_rpsubr, scm_less_p);
-#ifdef __STDC__
-SCM
-scm_less_p(SCM x, SCM y)
-#else
+
SCM
scm_less_p(x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_FLOATS
if SCM_NINUMP(x) {
SCM_PROC1 (s_gr_p, ">?", scm_tc7_rpsubr, scm_gr_p);
-#ifdef __STDC__
-SCM
-scm_gr_p(SCM x, SCM y)
-#else
+
SCM
scm_gr_p(x, y)
SCM x;
SCM y;
-#endif
{
return scm_less_p(y, x);
}
SCM_PROC1 (s_leq_p, "<=?", scm_tc7_rpsubr, scm_leq_p);
-#ifdef __STDC__
-SCM
-scm_leq_p(SCM x, SCM y)
-#else
+
SCM
scm_leq_p(x, y)
SCM x;
SCM y;
-#endif
{
return SCM_BOOL_NOT(scm_less_p(y, x));
}
SCM_PROC1 (s_geq_p, ">=?", scm_tc7_rpsubr, scm_geq_p);
-#ifdef __STDC__
-SCM
-scm_geq_p(SCM x, SCM y)
-#else
+
SCM
scm_geq_p(x, y)
SCM x;
SCM y;
-#endif
{
return SCM_BOOL_NOT(scm_less_p(x, y));
}
SCM_PROC(s_zero_p, "zero?", 1, 0, 0, scm_zero_p);
-#ifdef __STDC__
-SCM
-scm_zero_p(SCM z)
-#else
+
SCM
scm_zero_p(z)
SCM z;
-#endif
{
#ifdef SCM_FLOATS
if SCM_NINUMP(z) {
SCM_PROC(s_positive_p, "positive?", 1, 0, 0, scm_positive_p);
-#ifdef __STDC__
-SCM
-scm_positive_p(SCM x)
-#else
+
SCM
scm_positive_p(x)
SCM x;
-#endif
{
#ifdef SCM_FLOATS
if SCM_NINUMP(x) {
SCM_PROC(s_negative_p, "negative?", 1, 0, 0, scm_negative_p);
-#ifdef __STDC__
-SCM
-scm_negative_p(SCM x)
-#else
+
SCM
scm_negative_p(x)
SCM x;
-#endif
{
#ifdef SCM_FLOATS
if SCM_NINUMP(x) {
SCM_PROC1 (s_max, "max", scm_tc7_asubr, scm_max);
-#ifdef __STDC__
-SCM
-scm_max(SCM x, SCM y)
-#else
+
SCM
scm_max(x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_FLOATS
double z;
SCM_PROC1 (s_min, "min", scm_tc7_asubr, scm_min);
-#ifdef __STDC__
-SCM
-scm_min(SCM x, SCM y)
-#else
+
SCM
scm_min(x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_FLOATS
double z;
SCM_PROC1 (s_sum, "+", scm_tc7_asubr, scm_sum);
-#ifdef __STDC__
-SCM
-scm_sum(SCM x, SCM y)
-#else
+
SCM
scm_sum(x, y)
SCM x;
SCM y;
-#endif
{
if SCM_UNBNDP(y) {
if SCM_UNBNDP(x) return SCM_INUM0;
SCM_PROC1 (s_difference, "-", scm_tc7_asubr, scm_difference);
-#ifdef __STDC__
-SCM
-scm_difference(SCM x, SCM y)
-#else
+
SCM
scm_difference(x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_FLOATS
if SCM_NINUMP(x) {
SCM_PROC1 (s_product, "*", scm_tc7_asubr, scm_product);
-#ifdef __STDC__
-SCM
-scm_product(SCM x, SCM y)
-#else
+
SCM
scm_product(x, y)
SCM x;
SCM y;
-#endif
{
if SCM_UNBNDP(y) {
if SCM_UNBNDP(x) return SCM_MAKINUM(1L);
}
-#ifdef __STDC__
-double
-scm_num2dbl (SCM a, char * why)
-#else
+
double
scm_num2dbl (a, why)
SCM a;
char * why;
-#endif
{
if (SCM_INUMP (a))
return (double) SCM_INUM (a);
SCM_PROC(s_fuck, "fuck", 1, 0, 0, scm_fuck);
-#ifdef __STDC__
-SCM
-scm_fuck (SCM a)
-#else
+
SCM
scm_fuck (a)
SCM a;
-#endif
{
return scm_makdbl (scm_num2dbl (a, "just because"), 0.0);
}
SCM_PROC1 (s_divide, "/", scm_tc7_asubr, scm_divide);
-#ifdef __STDC__
-SCM
-scm_divide(SCM x, SCM y)
-#else
+
SCM
scm_divide(x, y)
SCM x;
SCM y;
-#endif
{
#ifdef SCM_FLOATS
double d, r, i, a;
#ifdef SCM_FLOATS
SCM_PROC1 (s_asinh, "$asinh", scm_tc7_cxr, (SCM (*)()) scm_asinh);
-#ifdef __STDC__
-double
-scm_asinh(double x)
-#else
+
double
scm_asinh(x)
double x;
-#endif
{
return log(x+sqrt(x*x+1));
}
SCM_PROC1 (s_acosh, "$acosh", scm_tc7_cxr, (SCM (*)()) scm_acosh);
-#ifdef __STDC__
-double
-scm_acosh(double x)
-#else
+
double
scm_acosh(x)
double x;
-#endif
{
return log(x+sqrt(x*x-1));
}
SCM_PROC1 (s_atanh, "$atanh", scm_tc7_cxr, (SCM (*)()) scm_atanh);
-#ifdef __STDC__
-double
-scm_atanh(double x)
-#else
+
double
scm_atanh(x)
double x;
-#endif
{
return 0.5*log((1+x)/(1-x));
}
SCM_PROC1 (s_truncate, "truncate", scm_tc7_cxr, (SCM (*)()) scm_truncate);
-#ifdef __STDC__
-double
-scm_truncate(double x)
-#else
+
double
scm_truncate(x)
double x;
-#endif
{
if (x < 0.0) return -floor(-x);
return floor(x);
SCM_PROC1 (s_round, "round", scm_tc7_cxr, (SCM (*)()) scm_round);
-#ifdef __STDC__
-double
-scm_round(double x)
-#else
+
double
scm_round(x)
double x;
-#endif
{
double plus_half = x + 0.5;
double result = floor(plus_half);
SCM_PROC1 (s_exact_to_inexact, "exact->inexact", scm_tc7_cxr, (SCM (*)()) scm_exact_to_inexact);
-#ifdef __STDC__
-double
-scm_exact_to_inexact(double z)
-#else
+
double
scm_exact_to_inexact(z)
double z;
-#endif
{
return z;
}
struct dpair {double x, y;};
+static void scm_two_doubles SCM_P ((SCM z1, SCM z2, char *sstring, struct dpair *xy));
+
static void
scm_two_doubles(z1, z2, sstring, xy)
SCM z1, z2;
SCM_PROC(s_sys_expt, "$expt", 2, 0, 0, scm_sys_expt);
-#ifdef __STDC__
-SCM
-scm_sys_expt(SCM z1, SCM z2)
-#else
+
SCM
scm_sys_expt(z1, z2)
SCM z1;
SCM z2;
-#endif
{
struct dpair xy;
scm_two_doubles(z1, z2, s_sys_expt, &xy);
SCM_PROC(s_sys_atan2, "$atan2", 2, 0, 0, scm_sys_atan2);
-#ifdef __STDC__
-SCM
-scm_sys_atan2(SCM z1, SCM z2)
-#else
+
SCM
scm_sys_atan2(z1, z2)
SCM z1;
SCM z2;
-#endif
{
struct dpair xy;
scm_two_doubles(z1, z2, s_sys_atan2, &xy);
SCM_PROC(s_make_rectangular, "make-rectangular", 2, 0, 0, scm_make_rectangular);
-#ifdef __STDC__
-SCM
-scm_make_rectangular(SCM z1, SCM z2)
-#else
+
SCM
scm_make_rectangular(z1, z2)
SCM z1;
SCM z2;
-#endif
{
struct dpair xy;
scm_two_doubles(z1, z2, s_make_rectangular, &xy);
SCM_PROC(s_make_polar, "make-polar", 2, 0, 0, scm_make_polar);
-#ifdef __STDC__
-SCM
-scm_make_polar(SCM z1, SCM z2)
-#else
+
SCM
scm_make_polar(z1, z2)
SCM z1;
SCM z2;
-#endif
{
struct dpair xy;
scm_two_doubles(z1, z2, s_make_polar, &xy);
SCM_PROC(s_real_part, "real-part", 1, 0, 0, scm_real_part);
-#ifdef __STDC__
-SCM
-scm_real_part(SCM z)
-#else
+
SCM
scm_real_part(z)
SCM z;
-#endif
{
if SCM_NINUMP(z) {
# ifdef SCM_BIGDIG
SCM_PROC(s_imag_part, "imag-part", 1, 0, 0, scm_imag_part);
-#ifdef __STDC__
-SCM
-scm_imag_part(SCM z)
-#else
+
SCM
scm_imag_part(z)
SCM z;
-#endif
{
if SCM_INUMP(z) return SCM_INUM0;
# ifdef SCM_BIGDIG
SCM_PROC(s_magnitude, "magnitude", 1, 0, 0, scm_magnitude);
-#ifdef __STDC__
-SCM
-scm_magnitude(SCM z)
-#else
+
SCM
scm_magnitude(z)
SCM z;
-#endif
{
if SCM_INUMP(z) return scm_abs(z);
# ifdef SCM_BIGDIG
SCM_PROC(s_angle, "angle", 1, 0, 0, scm_angle);
-#ifdef __STDC__
-SCM
-scm_angle(SCM z)
-#else
+
SCM
scm_angle(z)
SCM z;
-#endif
{
double x, y = 0.0;
if SCM_INUMP(z) {x = (z>=SCM_INUM0) ? 1.0 : -1.0; goto do_angle;}
SCM_PROC(s_inexact_to_exact, "inexact->exact", 1, 0, 0, scm_inexact_to_exact);
-#ifdef __STDC__
-SCM
-scm_inexact_to_exact(SCM z)
-#else
+
SCM
scm_inexact_to_exact(z)
SCM z;
-#endif
{
if SCM_INUMP(z) return z;
# ifdef SCM_BIGDIG
#else /* ~SCM_FLOATS */
SCM_PROC(s_trunc, "truncate", 1, 0, 0, scm_trunc);
-#ifdef __STDC__
-SCM
-scm_trunc(SCM x)
-#else
+
SCM
scm_trunc(x)
SCM x;
-#endif
{
SCM_ASSERT(SCM_INUMP(x), x, SCM_ARG1, s_truncate);
return x;
#ifdef SCM_BIGDIG
# ifdef SCM_FLOATS
/* d must be integer */
-#ifdef __STDC__
-SCM
-scm_dbl2big(double d)
-#else
+
SCM
scm_dbl2big(d)
double d;
-#endif
{
scm_sizet i = 0;
long c;
-#ifdef __STDC__
-double
-scm_big2dbl(SCM b)
-#else
+
double
scm_big2dbl(b)
SCM b;
-#endif
{
double ans = 0.0;
scm_sizet i = SCM_NUMDIGS(b);
# endif
#endif
-#ifdef __STDC__
-SCM
-scm_long2num(long sl)
-#else
+
SCM
scm_long2num(sl)
long sl;
-#endif
{
if (!SCM_FIXABLE(sl)) {
#ifdef SCM_BIGDIG
#ifdef LONGLONGS
-#ifdef __STDC__
-SCM
-scm_long_long2num(long_long sl)
-#else
+
SCM
scm_long_long2num(sl)
long_long sl;
-#endif
{
if (!SCM_FIXABLE(sl)) {
#ifdef SCM_BIGDIG
#endif
-#ifdef __STDC__
-SCM
-scm_ulong2num(unsigned long sl)
-#else
+
SCM
scm_ulong2num(sl)
unsigned long sl;
-#endif
{
if (!SCM_POSFIXABLE(sl)) {
#ifdef SCM_BIGDIG
return SCM_MAKINUM(sl);
}
-#ifdef __STDC__
-long
-scm_num2long(SCM num, char *pos, char *s_caller)
-#else
+
long
scm_num2long(num, pos, s_caller)
SCM num;
char *pos;
char *s_caller;
-#endif
{
long res;
if (SCM_INUMP(num))
-#ifdef __STDC__
-long
-num2long(SCM num, char *pos, char *s_caller)
-#else
+
long
num2long(num, pos, s_caller)
SCM num;
char *pos;
char *s_caller;
-#endif
{
long res;
if SCM_INUMP(num) {
#ifdef LONGLONGS
-#ifdef __STDC__
-long_long
-scm_num2long_long(SCM num, char *pos, char *s_caller)
-#else
+
long_long
scm_num2long_long(num, pos, s_caller)
SCM num;
char *pos;
char *s_caller;
-#endif
{
long_long res;
if SCM_INUMP(num) {
#endif
-#ifdef __STDC__
-unsigned long
-scm_num2ulong(SCM num, char *pos, char *s_caller)
-#else
+
unsigned long
scm_num2ulong(num, pos, s_caller)
SCM num;
char *pos;
char *s_caller;
-#endif
{
unsigned long res;
if (SCM_INUMP(num))
#ifdef SCM_FLOATS
# ifndef DBL_DIG
+static void add1 SCM_P ((double f, double *fsum));
static void add1(f, fsum)
double f, *fsum;
{
#endif
-#ifdef __STDC__
-void
-scm_init_numbers (void)
-#else
+
void
scm_init_numbers ()
-#endif
{
#ifdef SCM_FLOATS
SCM_NEWCELL(scm_flo0);