--- numbers.c.~1.243.~ 2004-05-12 07:19:25.000000000 +1000 +++ numbers.c 2004-05-17 07:36:30.000000000 +1000 @@ -5007,6 +5007,15 @@ "round towards the even one.") #define FUNC_NAME s_scm_round_number { + if (SCM_INUMP (x) || SCM_BIGP (x)) + return x; + else if (SCM_REALP (x)) + return scm_make_real (scm_round (SCM_REAL_VALUE (x))); + else + { + /* OPTIMIZE-ME: Fraction case could be done more efficiently by a + single quotient+remainder division then examining to see which way + 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. */ @@ -5015,6 +5024,7 @@ return scm_difference (result, SCM_MAKINUM (1)); else return result; + } } #undef FUNC_NAME