mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-13 07:47:39 +02:00
Bignum support for (abs)
This commit is contained in:
parent
1affaad8b1
commit
a6a0667b1c
1 changed files with 4 additions and 0 deletions
|
@ -1047,6 +1047,10 @@
|
||||||
" Cyc_check_num(data, num);
|
" Cyc_check_num(data, num);
|
||||||
if (obj_is_int(num)) {
|
if (obj_is_int(num)) {
|
||||||
return_closcall1(data, k, obj_int2obj( abs( obj_obj2int(num))));
|
return_closcall1(data, k, obj_int2obj( abs( obj_obj2int(num))));
|
||||||
|
} else if (is_object_type(num) && type_of(num) == bignum_tag){
|
||||||
|
alloc_bignum(data, bn);
|
||||||
|
mp_abs(&bignum_value(num), &bignum_value(bn));
|
||||||
|
return_closcall1(data, k, bn);
|
||||||
} else {
|
} else {
|
||||||
make_double(d, fabs(((double_type *)num)->value));
|
make_double(d, fabs(((double_type *)num)->value));
|
||||||
return_closcall1(data, k, &d);
|
return_closcall1(data, k, &d);
|
||||||
|
|
Loading…
Add table
Reference in a new issue