Cyclone Scheme  0.9
#define return_inexact_double_or_cplx_op (   data,
  cont,
  OP,
  CPLX_OP,
 
)
Value:
make_double(d, 0.0); \
Cyc_check_num(data, z); \
if (obj_is_int(z)) { \
d.value = OP(obj_obj2int(z)); \
} else if (type_of(z) == integer_tag) { \
d.value = OP(((integer_type *)z)->value); \
} else if (type_of(z) == bignum_tag) { \
d.value = OP(mp_get_double(&bignum_value(z))); \
} else if (type_of(z) == complex_num_tag) { \
complex_num_type cn; \
double complex unboxed = CPLX_OP(complex_num_value(z)); \
assign_complex_num((&cn), unboxed); \
return_closcall1(data, cont, &cn); \
} else { \
d.value = OP(((double_type *)z)->value); \
} \
return_closcall1(data, cont, &d)
#define Cyc_check_num(d, obj)
Definition: runtime.h:75
#define assign_complex_num(pobj, v)
Definition: types.h:752
Definition: types.h:59
Definition: types.h:49
Double-precision floating point type, also known as a flonum.
Definition: types.h:761
#define obj_obj2int(x)
Definition: types.h:534
#define obj_is_int(x)
Definition: types.h:528
#define type_of(obj)
Definition: types.h:75
double mp_get_double(mp_int *a)
Definition: runtime.c:1325
#define make_double(n, v)
Definition: types.h:768
Deprecated - boxed integers.
Definition: types.h:709
#define return_closcall1(td, clo, a1)
Definition: mstreams.c:22
#define bignum_value(x)
Definition: types.h:789
#define complex_num_value(x)
Definition: types.h:792
Definition: types.h:50