Issue #55 - Add complex_num_type definition

This commit is contained in:
Justin Ethier 2018-05-08 13:41:00 -04:00
parent cb7c208ddf
commit 3c467516c3
2 changed files with 12 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#define CYCLONE_TYPES_H #define CYCLONE_TYPES_H
#include <math.h> #include <math.h>
#include <complex.h>
#include <setjmp.h> #include <setjmp.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@ -55,6 +56,7 @@ enum object_tag {
, string_tag // 18 , string_tag // 18
, symbol_tag // 19 , symbol_tag // 19
, vector_tag // 20 , vector_tag // 20
, complex_num_tag // 21
}; };
#define type_is_pair_prim(clo) \ #define type_is_pair_prim(clo) \
@ -676,6 +678,15 @@ typedef struct {
#define alloc_bignum(data, p) \ #define alloc_bignum(data, p) \
bignum_type *p = gc_alloc_bignum((gc_thread_data *)data); bignum_type *p = gc_alloc_bignum((gc_thread_data *)data);
/**
* @brief Complex number
*/
typedef struct {
gc_header_type hdr;
tag_type tag;
double complex value;
} complex_num_type;
/** /**
* @brief Double-precision floating point type, also known as a flonum. * @brief Double-precision floating point type, also known as a flonum.
*/ */

View file

@ -53,6 +53,7 @@ const char *tag_names[] = {
/*string_tag */ , "string" /*string_tag */ , "string"
/*symbol_tag */ , "symbol" /*symbol_tag */ , "symbol"
/*vector_tag */ , "vector" /*vector_tag */ , "vector"
/*complex_num_tag*/ , "complex number"
, "Reserved for future use" , "Reserved for future use"
}; };