mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
* numbers.c (scm_make_ratio): Don't declare divisible_p after
statements.
This commit is contained in:
parent
4bca30d83a
commit
0b0c8e3b4c
1 changed files with 6 additions and 4 deletions
|
@ -392,11 +392,13 @@ scm_make_ratio (SCM numerator, SCM denominator)
|
||||||
/* both are bignums */
|
/* both are bignums */
|
||||||
if (SCM_EQ_P (numerator, denominator))
|
if (SCM_EQ_P (numerator, denominator))
|
||||||
return SCM_MAKINUM(1);
|
return SCM_MAKINUM(1);
|
||||||
int divisible_p = mpz_divisible_p (SCM_I_BIG_MPZ (numerator),
|
if (mpz_divisible_p (SCM_I_BIG_MPZ (numerator),
|
||||||
SCM_I_BIG_MPZ (denominator));
|
SCM_I_BIG_MPZ (denominator)))
|
||||||
if (divisible_p)
|
|
||||||
return scm_divide(numerator, denominator);
|
return scm_divide(numerator, denominator);
|
||||||
else return scm_double_cell (scm_tc16_fraction, (scm_t_bits)numerator, (scm_t_bits)denominator, 0);
|
else
|
||||||
|
return scm_double_cell (scm_tc16_fraction,
|
||||||
|
(scm_t_bits)numerator,
|
||||||
|
(scm_t_bits)denominator, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else SCM_WRONG_TYPE_ARG (1, numerator);
|
else SCM_WRONG_TYPE_ARG (1, numerator);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue