1 |
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. |
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002, 2003 Free Software Foundation, Inc. |
2 |
* |
* |
3 |
* Portions Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories |
* Portions Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories |
4 |
* and Bellcore. See scm_divide. |
* and Bellcore. See scm_divide. |
289 |
#undef FUNC_NAME |
#undef FUNC_NAME |
290 |
|
|
291 |
|
|
292 |
SCM_GPROC (s_abs, "abs", 1, 0, 0, scm_abs, g_abs); |
SCM_PRIMITIVE_GENERIC (scm_abs, "abs", 1, 0, 0, |
293 |
/* "Return the absolute value of @var{x}." |
(SCM x), |
294 |
*/ |
"Return the absolute value of @var{x}.") |
295 |
SCM |
#define FUNC_NAME |
|
scm_abs (SCM x) |
|
296 |
{ |
{ |
297 |
if (SCM_INUMP (x)) { |
if (SCM_INUMP (x)) { |
298 |
long int xx = SCM_INUM (x); |
long int xx = SCM_INUM (x); |
316 |
} else if (SCM_REALP (x)) { |
} else if (SCM_REALP (x)) { |
317 |
return scm_make_real (fabs (SCM_REAL_VALUE (x))); |
return scm_make_real (fabs (SCM_REAL_VALUE (x))); |
318 |
} else { |
} else { |
319 |
SCM_WTA_DISPATCH_1 (g_abs, x, 1, s_abs); |
SCM_WTA_DISPATCH_1 (g_scm_abs, x, 1, s_scm_abs); |
320 |
} |
} |
321 |
} |
} |
322 |
|
#undef FUNC_NAME |
323 |
|
|
324 |
|
|
325 |
SCM_GPROC (s_quotient, "quotient", 2, 0, 0, scm_quotient, g_quotient); |
SCM_GPROC (s_quotient, "quotient", 2, 0, 0, scm_quotient, g_quotient); |