mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 13:49:16 +02:00
Issue #519 - numerator/denominator
Return fixnum or bignum values from this function when they are passed as arg, per R7RS.
This commit is contained in:
parent
ffcbca6c3e
commit
d048b3d4f0
1 changed files with 6 additions and 0 deletions
|
@ -8636,6 +8636,12 @@ void Cyc_get_ratio(void *data, object cont, object n, int numerator)
|
||||||
// Special case
|
// Special case
|
||||||
make_double(val, 1.0);
|
make_double(val, 1.0);
|
||||||
return_closcall1(data, cont, &val);
|
return_closcall1(data, cont, &val);
|
||||||
|
} else if (obj_is_int(n) || type_of(n) == bignum_tag) {
|
||||||
|
if (numerator) {
|
||||||
|
return_closcall1(data, cont, n);
|
||||||
|
} else {
|
||||||
|
return_closcall1(data, cont, obj_int2obj((1)));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
double numer, denom;
|
double numer, denom;
|
||||||
make_double(val, 0.0);
|
make_double(val, 0.0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue