mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 08:47:35 +02:00
WIP
This commit is contained in:
parent
8c4ec056c8
commit
50f2c34f4a
1 changed files with 6 additions and 4 deletions
10
runtime.c
10
runtime.c
|
@ -3106,6 +3106,7 @@ object Cyc_expt(void *data, object cont, object z1, object z2)
|
|||
object Cyc_bignum_normalize(void *data, object n)
|
||||
{
|
||||
mp_int bn;
|
||||
object result;
|
||||
if (!is_object_type(n) || type_of(n) != bignum_tag) {
|
||||
return n;
|
||||
}
|
||||
|
@ -3113,12 +3114,13 @@ object Cyc_bignum_normalize(void *data, object n)
|
|||
mp_init(&bn);
|
||||
mp_set_int(&bn, CYC_FIXNUM_MAX);
|
||||
if (mp_cmp_mag(&bignum_value(n), &bn) == MP_GT) {
|
||||
mp_clear(&bn);
|
||||
return n;
|
||||
result = n;
|
||||
} else {
|
||||
mp_clear(&bn);
|
||||
return obj_obj2int( TODO: get signed bignum int value
|
||||
result = return obj_obj2int( TODO: get signed bignum int value
|
||||
}
|
||||
|
||||
mp_clear(&bn);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* I/O functions */
|
||||
|
|
Loading…
Add table
Reference in a new issue