]> gitweb.factorcode.org Git - factor.git/blob - native/complex.h
Factor jEdit plugin!
[factor.git] / native / complex.h
1 typedef struct {
2         CELL real;
3         CELL imaginary;
4 } COMPLEX;
5
6 INLINE COMPLEX* untag_complex(CELL tagged)
7 {
8         type_check(COMPLEX_TYPE,tagged);
9         return (COMPLEX*)UNTAG(tagged);
10 }
11
12 INLINE CELL tag_complex(RATIO* ratio)
13 {
14         return RETAG(ratio,COMPLEX_TYPE);
15 }
16
17 COMPLEX* complex(CELL real, CELL imaginary);
18 CELL possibly_complex(CELL real, CELL imaginary);
19
20 void primitive_complexp(void);
21 void primitive_real(void);
22 void primitive_imaginary(void);
23 void primitive_to_rect(void);
24 void primitive_from_rect(void);
25 CELL number_eq_complex(CELL x, CELL y);
26 CELL add_complex(CELL x, CELL y);
27 CELL subtract_complex(CELL x, CELL y);
28 CELL multiply_complex(CELL x, CELL y);
29 CELL divide_complex(CELL x, CELL y);
30 CELL divfloat_complex(CELL x, CELL y);
31 CELL less_complex(CELL x, CELL y);
32 CELL lesseq_complex(CELL x, CELL y);
33 CELL greater_complex(CELL x, CELL y);
34 CELL greatereq_complex(CELL x, CELL y);