mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Issue #519 - fix bignum TODO's in Cyc_remainder
This commit is contained in:
parent
38276ffd46
commit
88fb4b909f
1 changed files with 11 additions and 15 deletions
16
runtime.c
16
runtime.c
|
@ -4660,11 +4660,9 @@ void Cyc_remainder(void *data, object cont, object num1, object num2)
|
||||||
Cyc_bignum_remainder(data, cont, num1, num2, rem);
|
Cyc_bignum_remainder(data, cont, num1, num2, rem);
|
||||||
}
|
}
|
||||||
else if (is_object_type(num2) && type_of(num2) == double_tag){
|
else if (is_object_type(num2) && type_of(num2) == double_tag){
|
||||||
// TODO: correct to convert bignum to double here
|
ii = mp_get_double(&bignum_value(num1));
|
||||||
j = ((double_type *)num2)->value;
|
jj = ((double_type *)num2)->value;
|
||||||
alloc_bignum(data, bn);
|
goto handledouble;
|
||||||
Cyc_int2bignum(obj_obj2int(j), &(bn->bn));
|
|
||||||
Cyc_bignum_remainder(data, cont, num1, bn, bn);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goto typeerror;
|
goto typeerror;
|
||||||
|
@ -4676,11 +4674,9 @@ void Cyc_remainder(void *data, object cont, object num1, object num2)
|
||||||
goto handledouble;
|
goto handledouble;
|
||||||
}
|
}
|
||||||
else if (is_object_type(num2) && type_of(num2) == bignum_tag){
|
else if (is_object_type(num2) && type_of(num2) == bignum_tag){
|
||||||
// TODO: convert bignum to double here
|
ii = ((double_type *)num1)->value;
|
||||||
i = ((double_type *)num1)->value;
|
jj = mp_get_double(&bignum_value(num2));
|
||||||
alloc_bignum(data, bn);
|
goto handledouble;
|
||||||
Cyc_int2bignum(obj_obj2int(i), &(bn->bn));
|
|
||||||
Cyc_bignum_remainder(data, cont, bn, num2, bn);
|
|
||||||
}
|
}
|
||||||
else if (is_object_type(num2) && type_of(num2) == double_tag){
|
else if (is_object_type(num2) && type_of(num2) == double_tag){
|
||||||
ii = ((double_type *)num1)->value;
|
ii = ((double_type *)num1)->value;
|
||||||
|
|
Loading…
Add table
Reference in a new issue