1388 |
if (((nlen << SCM_BIGSIZEFIELD) >> SCM_BIGSIZEFIELD) != nlen) |
if (((nlen << SCM_BIGSIZEFIELD) >> SCM_BIGSIZEFIELD) != nlen) |
1389 |
scm_memory_error (s_bignum); |
scm_memory_error (s_bignum); |
1390 |
|
|
1391 |
base = scm_must_malloc (nlen * sizeof (SCM_BIGDIG), s_bignum); |
base = scm_gc_malloc (nlen * sizeof (SCM_BIGDIG), s_bignum); |
1392 |
|
|
1393 |
v = scm_alloc_cell (SCM_MAKE_BIGNUM_TAG (nlen, sign), (scm_t_bits) base); |
v = scm_alloc_cell (SCM_MAKE_BIGNUM_TAG (nlen, sign), (scm_t_bits) base); |
1394 |
return v; |
return v; |
1424 |
{ |
{ |
1425 |
SCM_BIGDIG *digits |
SCM_BIGDIG *digits |
1426 |
= ((SCM_BIGDIG *) |
= ((SCM_BIGDIG *) |
1427 |
scm_must_realloc ((char *) SCM_BDIGITS (b), |
scm_gc_realloc (SCM_BDIGITS (b), |
1428 |
(long) (SCM_NUMDIGS (b) * sizeof (SCM_BIGDIG)), |
SCM_NUMDIGS (b) * sizeof (SCM_BIGDIG), |
1429 |
(long) (nsiz * sizeof (SCM_BIGDIG)), s_bignum)); |
nsiz * sizeof (SCM_BIGDIG), s_bignum)); |
1430 |
|
|
1431 |
SCM_SET_BIGNUM_BASE (b, digits); |
SCM_SET_BIGNUM_BASE (b, digits); |
1432 |
SCM_SETNUMDIGS (b, nsiz, SCM_BIGSIGN (b)); |
SCM_SETNUMDIGS (b, nsiz, SCM_BIGSIGN (b)); |
2840 |
return scm_make_real (x); |
return scm_make_real (x); |
2841 |
} else { |
} else { |
2842 |
SCM z; |
SCM z; |
2843 |
SCM_NEWSMOB (z, scm_tc16_complex, scm_must_malloc (2L * sizeof (double), "complex")); |
SCM_NEWSMOB (z, scm_tc16_complex, scm_gc_malloc (2*sizeof (double), |
2844 |
|
"complex")); |
2845 |
SCM_COMPLEX_REAL (z) = x; |
SCM_COMPLEX_REAL (z) = x; |
2846 |
SCM_COMPLEX_IMAG (z) = y; |
SCM_COMPLEX_IMAG (z) = y; |
2847 |
return z; |
return z; |