mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-26 14:32:11 -08:00
complex float: add types and structures to core runtime
t_csfloat - ecl_csfloat, t_cdfloat - ecl_cdfloat, t_clfloat - ecl_clfloat.
This commit is contained in:
parent
e7725d4bcf
commit
6ecd2473c4
2 changed files with 36 additions and 1 deletions
|
|
@ -413,6 +413,11 @@ static printer dispatch[FREE+1] = {
|
|||
write_float, /* t_longfloat */
|
||||
#endif
|
||||
write_complex, /* t_complex */
|
||||
#ifdef ECL_COMPLEX_FLOAT
|
||||
write_illegal, /* t_csfloat */
|
||||
write_illegal, /* t_cdfloat */
|
||||
write_illegal, /* t_clfloat */
|
||||
#endif
|
||||
_ecl_write_symbol, /* t_symbol */
|
||||
write_package, /* t_package */
|
||||
write_hashtable, /* t_hashtable */
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ typedef enum {
|
|||
t_start = 0,
|
||||
t_list = 1,
|
||||
/* The most specific numeric types come first. Assumed by
|
||||
some routines, like cl_expt */
|
||||
some routines, like cl_expt. See ANSI 12.1.1.2. */
|
||||
t_character = 2, /* immediate character */
|
||||
t_fixnum = 3, /* immediate fixnum */
|
||||
t_bignum = 4,
|
||||
|
|
@ -53,6 +53,11 @@ typedef enum {
|
|||
t_longfloat,
|
||||
#endif
|
||||
t_complex,
|
||||
#ifdef ECL_COMPLEX_FLOAT
|
||||
t_csfloat,
|
||||
t_cdfloat,
|
||||
t_clfloat,
|
||||
#endif
|
||||
t_symbol,
|
||||
t_package,
|
||||
t_hashtable,
|
||||
|
|
@ -231,6 +236,26 @@ struct ecl_complex {
|
|||
cl_object imag; /* imaginary part, must be a number */
|
||||
};
|
||||
|
||||
#ifdef ECL_COMPLEX_FLOAT
|
||||
struct ecl_csfloat {
|
||||
_ECL_HDR;
|
||||
float _Complex value;
|
||||
};
|
||||
#define ecl_csfloat(o) ((o)->csfloat.value)
|
||||
|
||||
struct ecl_cdfloat {
|
||||
_ECL_HDR;
|
||||
double _Complex value;
|
||||
};
|
||||
#define ecl_cdfloat(o) ((o)->cdfloat.value)
|
||||
|
||||
struct ecl_clfloat {
|
||||
_ECL_HDR;
|
||||
long double _Complex value;
|
||||
};
|
||||
#define ecl_clfloat(o) ((o)->clfloat.value)
|
||||
#endif
|
||||
|
||||
enum ecl_stype { /* symbol type */
|
||||
ecl_stp_ordinary = 0,
|
||||
ecl_stp_constant = 1,
|
||||
|
|
@ -1031,6 +1056,11 @@ union cl_lispunion {
|
|||
struct ecl_long_float longfloat; /* long-float */
|
||||
#endif
|
||||
struct ecl_complex complex; /* complex number */
|
||||
#ifdef ECL_COMPLEX_FLOAT
|
||||
struct ecl_csfloat csfloat; /* complex single float */
|
||||
struct ecl_cdfloat cdfloat; /* complex double float */
|
||||
struct ecl_clfloat clfloat; /* complex long float */
|
||||
#endif
|
||||
struct ecl_symbol symbol; /* symbol */
|
||||
struct ecl_package pack; /* package */
|
||||
struct ecl_hashtable hash; /* hash table */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue