- if (y < 0)
- return scm_double_cell (scm_tc16_fraction, (scm_t_bits)SCM_MAKINUM(-x), (scm_t_bits)SCM_MAKINUM(-y), 0);
- else return scm_double_cell (scm_tc16_fraction, (scm_t_bits)numerator, (scm_t_bits)denominator, 0);
- }
- else
- {
- /* I assume bignums are actually big, so here there's no point in looking for a integer */
- int sgn = mpz_sgn (SCM_I_BIG_MPZ (denominator));
- if (sgn < 0) /* if denominator negative, flip signs */
- return scm_double_cell (scm_tc16_fraction,
- (scm_t_bits)scm_difference (numerator, SCM_UNDEFINED),
- (scm_t_bits)scm_difference (denominator, SCM_UNDEFINED),
- 0);
- else return scm_double_cell (scm_tc16_fraction, (scm_t_bits)numerator, (scm_t_bits)denominator, 0);
-
- /* should this use SCM_UNPACK for the bignums? */