deprecate something, move it here when that is feasible.
*/
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
return scm_to_intmax (obj);
}
+double
+scm_truncate (double x)
+{
+ scm_c_issue_deprecation_warning
+ ("scm_truncate is deprecated. Use scm_c_truncate instead.");
+ return scm_c_truncate (x);
+}
+
+double
+scm_round (double x)
+{
+ scm_c_issue_deprecation_warning
+ ("scm_round is deprecated. Use scm_c_round instead.");
+ return scm_c_round (x);
+}
+
void
scm_i_init_deprecated ()
{
*/
-/* XXX - eventually, we should remove this definition of scm_round and
- rename scm_round_number to scm_round. Likewise for scm_truncate
- and scm_truncate_number.
- */
-
double
-scm_truncate (double x)
+scm_c_truncate (double x)
{
#if HAVE_TRUNC
return trunc (x);
#endif
}
-/* scm_round is done using floor(x+0.5) to round to nearest and with
- half-way case (ie. when x is an integer plus 0.5) going upwards. Then
- half-way cases are identified and adjusted down if the round-upwards
- didn't give the desired even integer.
+/* scm_c_round is done using floor(x+0.5) to round to nearest and with
+ half-way case (ie. when x is an integer plus 0.5) going upwards.
+ Then half-way cases are identified and adjusted down if the
+ round-upwards didn't give the desired even integer.
"plus_half == result" identifies a half-way case. If plus_half, which is
x + 0.5, is an integer then x must be an integer plus 0.5.
an 0.5 to be represented, and hence added without a bad rounding. */
double
-scm_round (double x)
+scm_c_round (double x)
{
double plus_half, result;
plus_half = x + 0.5;
result = floor (plus_half);
- /* Adjust so that the scm_round is towards even. */
+ /* Adjust so that the rounding is towards even. */
return ((plus_half == result && plus_half / 2 != floor (plus_half / 2))
? result - 1
: result);
if (SCM_I_INUMP (x) || SCM_BIGP (x))
return x;
else if (SCM_REALP (x))
- return scm_from_double (scm_round (SCM_REAL_VALUE (x)));
+ return scm_from_double (scm_c_round (SCM_REAL_VALUE (x)));
else
{
/* OPTIMIZE-ME: Fraction case could be done more efficiently by a
the rounding should go. */
SCM plus_half = scm_sum (x, exactly_one_half);
SCM result = scm_floor (plus_half);
- /* Adjust so that the scm_round is towards even. */
+ /* Adjust so that the rounding is towards even. */
if (scm_is_true (scm_num_eq_p (plus_half, result))
&& scm_is_true (scm_odd_p (result)))
return scm_difference (result, SCM_I_MAKINUM (1));
SCM_API double scm_asinh (double x);
SCM_API double scm_acosh (double x);
SCM_API double scm_atanh (double x);
-SCM_API double scm_truncate (double x);
-SCM_API double scm_round (double x);
+SCM_API double scm_c_truncate (double x);
+SCM_API double scm_c_round (double x);
SCM_API SCM scm_truncate_number (SCM x);
SCM_API SCM scm_round_number (SCM x);
SCM_API SCM scm_sys_expt (SCM z1, SCM z2);