Cyclone Scheme  0.28.0

◆ return_inexact_double_or_cplx_op

#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)

Extract double or complex number and pass it in a call to continuation cont

integer_tag
@ integer_tag
Definition: types.h:61
obj_obj2int
#define obj_obj2int(x)
Definition: types.h:613
obj_is_int
#define obj_is_int(x)
Definition: types.h:607
bignum_value
#define bignum_value(x)
Definition: types.h:913
integer_type
Deprecated - boxed integers.
Definition: types.h:808
make_double
#define make_double(n, v)
Definition: types.h:884
type_of
#define type_of(obj)
Definition: types.h:92
bignum_tag
@ bignum_tag
Definition: types.h:62
double_type
Double-precision floating point type, also known as a flonum.
Definition: types.h:877
complex_num_value
#define complex_num_value(x)
Definition: types.h:916
complex_num_tag
@ complex_num_tag
Definition: types.h:70