mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 20:45:06 +02:00
Issue #433 - Special case, denominator of 0 is 1
This commit is contained in:
parent
95c3fea24f
commit
826e7895ae
1 changed files with 5 additions and 1 deletions
|
@ -8441,7 +8441,11 @@ void Cyc_get_ratio(void *data, object cont, object n, int numerator)
|
||||||
Cyc_rt_raise2(data, "Unable to convert to ratio", n);
|
Cyc_rt_raise2(data, "Unable to convert to ratio", n);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (!numerator && d == 0.0) {
|
||||||
|
// Special case
|
||||||
|
make_double(val, 1.0);
|
||||||
|
return_closcall1(data, cont, &val);
|
||||||
|
} else {
|
||||||
double numer, denom;
|
double numer, denom;
|
||||||
make_double(val, 0.0);
|
make_double(val, 0.0);
|
||||||
num2ratio(d, &numer, &denom);
|
num2ratio(d, &numer, &denom);
|
||||||
|
|
Loading…
Add table
Reference in a new issue